

Debugging in Python (2009) - mattyb
http://pythonconquerstheuniverse.wordpress.com/2009/09/10/debugging-in-python/

======
mrshoe
The lack of discussion about pdb on the internet speaks to Python's simplicity
and transparency. There just aren't many subtle traps to fall into from which
you need a debugger to free yourself.

At my current job I write C++ and I use a debugger practically every day. My
previous job was all Python and I reached for pdb maybe 3 times in 4 years.

~~~
hartror
I do find I use it reasonably often but have never reached for the
documentation once. Which speaks to the intuitiveness of pdb as much as my
experience with living in gdb when coding in C++.

I love using pdb when debugging django test cases find it faster than using
prints all over the place.

------
rarrrrrr
I prefer <http://winpdb.org/> (Not windows only.)

The debugger runs as a full screen GUI app, which you attach via sockets to a
running process, so you can easily debug stuff like FCGIs on other machines,
etc.

~~~
devinj
Worst named debugger of all time. I love how everyone always has to clarify
with "Not windows only" :)

~~~
jayliew
agreed! I've been using pdb to debug and I didn't know there was a pdb gui!

------
mclin
Or if you use PyDev for Eclipse:

import pydevd; pydevd.settrace('192.168.xxx.xxx')

Same kind of thing, but with full debug UI, and you can debug remote
processes, eg behind apache!

------
MOdMac
ipdb lets you use pdb in a ipython shell which makes it much more powerful.
<http://pypi.python.org/pypi/ipdb>

~~~
nailer
I hate 'me too' comments but IPDB IS A GODSEND. Once you use it you will:

* Wonder how you ever did without it

* Wonder why on earth it's not a standard part of Python

* Free your code of crappy conditional debug prints forever

* Take ipdb to bed and cuddle it at night

Just:

    
    
        import ipdb
    

Then where you'd like to start debugging:

    
    
        ipdb.set_trace()
    

Type 'help' for help.

------
bcl
There is also a fairly useful debug module named epdb from the guys at rpath.
It opens up a port and lets you netcat to it and debug remotely. This is great
for running things in a virt and being able to actually cut and paste to the
debug session.

<http://bitbucket.org/rpathsync/epdb>

------
simplegeek
Has anyone had any success with any Python debugger to debug multi-threaded
programs? Just asking out of curiosity.

------
kqueue
I still prefer prints

