Python Debugger / IDE ??

Larry Bates larry.bates at websafe.com
Tue Mar 14 18:07:39 EST 2006


krypto.wizard at gmail.com wrote:
> Is there any editor or IDE in Python (either Windows or Linux) which
> has very good debugging facilites like MS VisualStudio has or something
> like that.
> 
> I like SPE but couldn't easily use winPDP. I need tips to debug my code
> easily.
> 
> Every help is greatly appreciated.
> 
> Thanks
> 
I've found that using logging works well for me.  I put statements in
my program that log information, trace, intermediate results, ..., and
wrap them in trace/debug if statements.  Higher values of debug get more
"stuff" logged.  Then I leave everything in the program.  When something
goes wrong, run it with debug level and I can figure out what is
happening.  This is especially good when problem pops up 2 years from
now.  I just have client run with debug=4 and I look at the logfile.  If
you get in a habit of writing ALL your software this way, you find that
it is quite powerful and easy.  I haven't found the overhead of all the
if statements to be anything to worry about.  You can use the standard
library logging module (I wrote my own before it was available and I've
never changed to the one in the standard library).

-Larry Bates



More information about the Python-list mailing list