[IPython-User] replacing pdb with ipython 0.12

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


Hi!

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
     Pdb(def_colors).set_trace(sys._getframe().f_back)

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?

r.


More information about the IPython-User mailing list