#Debugging in IPython
Declared the function:
def debug(f, *args, **kwargs):
from pdb import Pdb as OldPdb
try:
from IPython.core.debugger import Pdb
kw = dict(color_scheme='Linux')
except ImportError:
Pdb = OldPdb
kw = {}
pdb = Pdb(**kw)
return pdb.runcall(f, *args, **kwargs)
You can invoke it on a function and arguments like so: Debugging in IPython
debug(test_function, arg1, arg2, named_arg1='hello')
You will get all the interactive IPython goodness as you step through your code.
[Thanks to @atomklein]