تشغيل مترجم بايثون عادي في فترة مروع من ipython مع قذيفة الإدارة

StackOverflow https://stackoverflow.com/questions/1295492

  •  18-09-2019
  •  | 
  •  

سؤال

لدي تثبيت ipython، أريد تشغيل مترجم ثعبان عادي بدلا من ذلك مع Shower.py Shell.

لذلك أحاول،

python2.5 manage.py shell --plain

مما أعطاني خطأ، والنص الذي يشير إلى أن - تم تمريره إلى iPython

لذلك قرأت، http://docs.djangoproject.com/en/dev/ref/django-admin/

التي suggets.

django-admin.py shell --plain

الذي يعطيني

Error: Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined.

الذي يبدو الشيء الصحيح لذلك للقيام به.

ما أنا أخوض هنا؟ [ubuntu jaunty، django.version = (1، 2، 0، "ألفا"، 0)، بيثون 2.5 و 2.6

هل كانت مفيدة؟

المحلول

إذا كان السبب في أنك تريد استخدام فريشتوري في بيثون على iPython هو لأنك تحتاج إلى لصق اختبارات DOC، فيمكنك تجربة الكتابة

%doctest_mode

في وحدة التحكم Ipython بدلا من ذلك

In [1]: %doctest_mode
*** Pasting of code with ">>>" or "..." has been enabled.
Exception reporting mode: Plain
Doctest mode is: ON
>>> 
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top