[Tutor] Debugger?

Alan G alan.gauld at freenet.co.uk
Sat May 21 22:19:28 CEST 2005


> I see so many errors when i execute my programs.
> 
> Where can i get debugger for python? or How can i debug a prgram?

import pdb gets you the standard python debugger.

But IDLE and Pythonwin etc have their own builtin graphical 
debuggers too.

But if you are getting a lot of errors the debugger is the wrong 
place to look. DEbuggers are for deep diagnostics when the simple 
things fail and usually only used on a single obscure fault at 
a time.

To deal with lots of errors use the >>> prompt to try things 
out before committing them to a file. THen import the "finished" 
file and try exercising the functions classes one by one from 
the >>> prompt. Finally  insert print statements at suitable 
points, and only after doing all of that try the debugger.

The best debugger of all is the one between your ears!

Alan G.


More information about the Tutor mailing list