debugging

Michael Hudson mwh at python.net
Fri Jan 23 07:23:39 EST 2004


writeson at earthlink.net (Doug Farrell) writes:

> 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

What have you tried?  pdb.run('...') and pdb.set_trace() may be your
friends.

> 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.

Well, quite a lot of the time I ... insert print statements in my
code.

I also find stopping and actually thinking hard every now and again
helps, too :-)

Cheers,
mwh

-- 
  ARTHUR:  Yes.  It was on display in the bottom of a locked filing
           cabinet stuck in a disused lavatory with a sign on the door
           saying "Beware of the Leopard".
                    -- The Hitch-Hikers Guide to the Galaxy, Episode 1



More information about the Python-list mailing list