[Tutor] [tutor] debug process

Dave Kuhlman dkuhlman at rexx.com
Tue Jun 13 17:45:28 CEST 2006

On Tue, Jun 13, 2006 at 08:51:49AM +0200, Wolfram Kraus wrote:
> emilia12 at mail.bg schrieb:
> > Hello,
> > 
> > Is there a way to debug (trace) the python code line by line?
> > 
> > emily
> > 
> Hi emily!
> You can use The Python Debugger or pdb, see:
> http://www.python.org/doc/2.4.2/lib/module-pdb.html

Also, put the following at the location in your code where you
want to drop into the debugger:

    import pdb

and then, at the pdb prompt, type:

    (Pdb) help l
    (Pdb) help b


You can also do:

    import pdb

which will show you documentation on pdb.

And, this is not a debugger but ...  If you have installed
IPython, you can also easily embed a complete Python interpreter
in your program.  Although it does not give you breakpoints and
other debugging features, it does enable you to do lots in the way
of inspecting objects, evaluating objects, performing tests on
objects, etc.

If you have *not* installed IPython, I recommend it.  It makes a
great replacement for the standard Python interactive interpreter.
To learn about IPython, see:

  Embedding IPython:
  Using the Python debugger (pdb) (with IPython):


Dave Kuhlman

More information about the Tutor mailing list