PuDB ships with IPython integration. Just stick the line:
into your $HOME/.ipython/ipy_user_conf.py (for IPython 0.10) or $HOME/ipython/profile_default/ipython_config.py (for IPython 0.11+), and then you may use the magic command:
%pudb script.py [args]
where [args] represents optional arguments, to launch PuDB from within IPython.
An alternative way to debug your code using PuDB and IPython is to simply insert the following:
import pudb; pudb.set_trace()
in your source code where you want the execution to stop. From IPython you can simply issue the command:
The execution of your code will stop at the chosen line giving you access to the PuDB window. This is a quite effective way to debug your code, especially when you have several source files.
Using PuDB as IPython's on-failure debugger
As of this writing (07/2010), IPython is undergoing a major refactoring, which may include better support for third-party debuggers such as PuDB. In the meantime, David Warde-Farley made an initial attempt at this: patch against IPython/iplib.py, thread on IPython-dev. Currently it intercepts %debug but not the %pdb autocall behaviour.