Differences between revisions 11 and 12
Revision 11 as of 2012-10-21 19:30:44
Size: 1712
Editor: c-98-230-218-153
Comment: Add path for new IPython
Revision 12 as of 2013-05-19 23:53:45
Size: 1392
Editor: 99-129-250-188
Comment:
Deletions are marked like this. Additions are marked like this.
Line 10: Line 10:
---- /!\ '''Edit conflict - other version:''' ----
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

----
/!\ '''Edit conflict - your version:''' ----
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

---- /!\ '''End of edit conflict''' ----
command:
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:

IPython integration

PuDB ships with IPython integration. Just stick the line:

import pudb.ipython

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:

%run your_code.py

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.

PuDB/IPythonIntegration (last edited 2013-05-19 23:53:45 by 99-129-250-188)