O'Reilly logo

NumPy Cookbook - Second Edition by Ivan Idris

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Debugging with PuDB

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.

How to do it...

We'll start with the installation of pudb:

  1. To install pudb, we only need to execute the following command (or the equivalent pip command):
    $ sudo easy_install pudb
    $ pip install pudb
    $ pip freeze|grep pudb
    pudb==2014.1
    
  2. 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:

    How to do it...

The screenshot shows the most important ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required