%run yourscript.pyWhile debugging exeptions, I prefer this over embedding ipython,
because the shell stops right after the exception is thrown.
When the exception is thrown, you get a stack trace, showing the exception.
Now enter the python debugger from within ipython
%debugYou can now use all the pdb features (pdb commands) as well as ipython functionality (think tab completion).
Walk up the stack trace until you get to your faulty code
u
edit your code in your favourite editor (outside ipython)
reload the changed code
Test the changed code, by rerunning the changed function or script.%load_ext autoreload %autoreload 2
That's how it should work. Somehow it doesn't for me. The same error gets thrown, although ipython shows the corrected code in the stack trace.
After restarting ipython it works fine ...
Keine Kommentare:
Kommentar veröffentlichen