Debugging in Python (2009)(pythonconquerstheuniverse.wordpress.com)
pythonconquerstheuniverse.wordpress.com
Debugging in Python (2009)
http://pythonconquerstheuniverse.wordpress.com/2009/09/10/debugging-in-python/
7 comments
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.
I love using pdb when debugging django test cases find it faster than using prints all over the place.
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.
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.
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!
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!
ipdb lets you use pdb in a ipython shell which makes it much more powerful.
http://pypi.python.org/pypi/ipdb
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:
* 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.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
http://bitbucket.org/rpathsync/epdb
Has anyone had any success with any Python debugger to debug multi-threaded programs? Just asking out of curiosity.
I still prefer prints
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.