debugging

Larry Bates lbates at swamisoft.com
Fri Jan 23 11:00:16 EST 2004


Doug,

I use a loggerclass to log debugging/tracing information
to a log file during the program execution.  I trigger these
logging statements by setting python variables _trace and
_debug at the top of my program execution (normally by reading
them from a .INI file using ConfigParser).  This way I can
trace/debug my program and then easily turn them off when
the code is finalized.  I leave this code in the application
and find that it can prove to be very valuable should a
problem arise in the future.  Just turn on trace/debug and
take a look at the log file.  I don't believe that there
is significant overhead in a few "if _debug: logf.writelines..."
statements in the code.

-Larry


"Doug Farrell" <writeson at earthlink.net> wrote in message
news:88bc63c6.0401230416.7acf904c at posting.google.com...
> Hi all,
>
> Can someone help me out a little with Python? What do people use to
> debug Python code? I don't understand how to use the built in debugger
> and I haven't had any luck getting ddd to debug my Python programs. I
> end up falling back on inserting print statements in my code to figure
> out what's going on. This works but isn't always the fastest route to
> a solution. So, I'm just wondering what other people do.
>
> Thanks,
> Doug





More information about the Python-list mailing list