Python's ipdb debugger is the default for IPython. It is similar to the standard pdb for Python but has extensions to make IPython easier to work with.
There are several different ways to access the debugger, both post-mortem and at program startup.
After an exception has occurred, the %debug
magic will start a post-mortem debugging session. This will launch the debugger at the point in the program at which the exception was raised.
The %pdb
magic will automatically launch the debugger upon the next exception, similar to manually calling %debug
. IPython can be started with the --pdb
switch for the same behavior.
Outside of IPython, post-mortem debugging can be invoked by including the following lines in your program:
import sys from IPython.core import ultratb sys.excepthook = ultratb.FormattedTB(mode='Verbose', color_scheme='Linux', call_pdb=1)