Last modified: Feb, 2014
The installation guide is here. In Ubuntu, it is as simple as
sudo apt-get install ipython
The module ipdb (IPython-enabled pdb) offers extra features that are not available in pdb. As of Ubuntu 12.04, ipdb is not in the repository. But it can be easily installed by pip
sudo apt-get install python-pip
sudo pip install ipdb
To insert a breakpoint to the code is as easy as
For example, an example Python script with name “tmp.py” and content as follows:
After executing the script
python tmp.py
it will enter ipdb debugging mode. There are several shortcut keys for debugging, such as “c” for “continue”, “n” for “next”, “q” for quitting debugging mode, etc.
Some useful posts on debugging with IPython