PuDB is a visual, full-screen, console-based Python debugger that is easy to install. PuDB supports cursor keys and vi commands. We can also integrate this debugger with IPython if required.
We'll start with the installation of pudb
:
To install
pudb
, we only need to execute the following command (or the equivalentpip
command):$ sudo easy_install pudb $ pip install pudb $ pip freeze|grep pudb pudb==2014.1
Let's debug the buggy program from the previous example. Start the debugger as follows:
$ python -m pudb buggy.py
The following screenshot shows the user interface of the debugger:
The screenshot shows the most important debugging commands at the top. We can also see the code being debugged, the variables, the stack, and the defined breakpoints. Typing q
exits most menus. Typing n
moves the debugger to the next line. We can also move with the cursor keys or vi j
and k
keys to, for instance, set a breakpoint by typing b
.
The PyPi PuDB page is at https...