Python debugging under Linux

Fernando Perez fperez528 at yahoo.com
Thu Feb 6 11:05:54 EST 2003


Paul Rubin wrote:

> What Python debugging environment to Linux users here like to use?
> 
> I've never gotten Emacs pdb mode or Idle to work under Linux.
> "ddd --pydb" only slightly works--it's like alpha test software.
> 
> I'm using Red Hat 7.2 with Emacs 20.7.1.  I have the impression that
> Emacs pdb mode may have worked once upon a time but broke somehow and
> nobody ever fixed it.  I haven't put any real effort into getting it
> working.  So I debug with a combination of manually operated pdb and
> print statements, but it's kind of a drag.

You can say I'm biased :) but my favorite for this is IPython: 
http://www-hep.colorado.edu/~fperez/ipython/.  Combining the auto-triggered 
pdb at exceptions with the embedded ipython shells inside code, I rarely 
need anything else (I've used both ddd and Xemacs, and still prefer 
ipython).  

The auto-triggered pdb has the advantage of popping up right inside the code 
where an exception was generated with the whole stack still alive. It's 
then trivial to walk up and down through it searching for the cause of the 
problem.

For problems where a bit of fancier poking around inside my code is needed 
but I want the data to be alive (plotting it for example, my field is 
scientific computing), the easiest solution is to embed ipython (two lines 
atop the code) and then open the embedded shell where I need it (a single 
function call).

But again, I'm biased, so don't take my word for it.

Cheers,

f.




More information about the Python-list mailing list