[Tutor] Checking/Debugging tools

Kent Johnson kent37 at tds.net
Sun May 13 01:46:01 CEST 2007

Alan Gilfoy wrote:
> Quoting Kent Johnson <kent37 at tds.net>:

>> - A debugger lets you step through the code and see how it behaves.
>> winpdb is a pretty nice GUI-based Python debugger and some Python
>> development tools have built-in debuggers.
>> http://www.digitalpeers.com/pythondebugger/
> I got winpdb downloaded, but when I tried to run the script, it said I
> needed wxpython. I tried to go to the wxpytohn website, and it's
> evidently down right now.

It seems to be working now:

>> - The Python profiler will tell you (after the fact) how much time you
>> spend in each function. To see what part of a loop the program is in
>> you would have to break the loop up into functions.
>> http://docs.python.org/lib/profile.html
> My loop isn't broken into functions, just a truckload of if statements

Perhaps you could break out some pieces into functions.

>> - A code coverage tool will tell you (after the fact) which lines of
>> the program were executed and which were not. (google python code
>> coverage)
> Running that Google Search, I seem to be running into a lot of what
> is, to me, technical gobbeldygook. Can y'all help me choose a good
> code-coverage tool, and a good tutorial?

The first link is an ad. The second link is for Ned Batcheldor's 
coverage module which seems to include pretty good docs. The third link 
is a recipe that creates a nice presentation of the output of coverage, 
with an example.


More information about the Tutor mailing list