Debugging Python code

On first search, you will see a lot of options and obvious conclusion is that you will not be satisfied.

Most people just prefers plain import pdb; pdb.set_trace() and python -m pdb app.py.

Start at http://docs.python.org/library/pdb.html and https://pythonconquerstheuniverse.wordpress.com/2009/09/10/debugging-in-python/

If you like vim two options with the same name (just different case):

https://github.com/gotcha/vimpdb (actively maintained)
https://code.google.com/p/vimpdb/ (no commits since Oct 16, 2007 )

First one is actively maintained, second one didn’t work right for me.
Simplest explanation i found how the first one is from:
http://www.eletztrick.de/software/vimpdb

How does (should) that work?
vimpdb is a subclass of pdb.Pdb, which hijacks the command loop and listens for UDP packets on port 6666 (blocking). To inform the VIM process what’s happening, it uses VIM’s remote commands.
On the VIM side there’s basically just a VIM script which does the higlight, set up the menu, and defines a function to send UDP messages.
That’s all.

For the rest go to github page for whole README.

I also use Eric4 IDE for it’s debugging capabilities, and first thing to notice that Eric needs that debugger more than you.
It is still functioning, if all other bloat and strange configuration does not bother you too much.

http://winpdb.org/about/
winpdb is wxWidgets option, works on multiple operative systems, most usable off all, but depends what you are looking for, and how much will it disrupt your coding session. Sometimes it is harder to switch from favorite editor to full blown GUI for debugging, then staying in the same place, or switching to console debugger. And having wxWidgets installed is just filthy.

winpdb

winpdb screenshot

Advertisements


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s