[IPython-User] replacing pdb with ipython 0.12

Robert Cimrman cimrman3@ntc.zcu...
Thu Jan 19 04:18:03 CST 2012


Up to ipython 0.10.2, I have used the following code

import sys
old_excepthook = sys.excepthook

from IPython.Debugger import Pdb
from IPython.Shell import IPShell
from IPython import ipapi

def debug():
     shell = IPShell(argv=[''])
     sys.excepthook = old_excepthook
     ip = ipapi.get()
     def_colors = ip.options.colors

to replace pdb.set_trace() call - instead I call debug() and get ipython prompt 
at the corresponding line of the code, with colors, tab-completion etc.

How to upgrade the code for >= 0.11?


More information about the IPython-User mailing list