Re: How to debug python code?



Am Thu, 30 Mar 2006 21:18:50 -0800 schrieb sushant.sirsikar:
hi,
I am new to Python programming.I am not getting exactly pdb.Can
anyone tell me effective way to debug python code?

Hi,

I try to debug the code while I type: Use "assert".

Then if you get an AssertionError you can insert print statements or
raise("var=%s var2=%s" % (var, var2))
to narrow down the problem. I never used pdb.

HTH,
Thomas

--
Thomas Güttler, http://www.thomas-guettler.de/
E-Mail: guettli (*) thomas-guettler + de
Spam Catcher: niemand.leermann@xxxxxxxxxxxxxxxxxx

.



Relevant Pages

  • Re: How to debug python code?
    ... anyone tell me effective way to debug python code? ... Looking for responce. ... thread) this is an obvious place to plug pydb ... If you are using pdb, I think you'll find pydb, um, better. ...
    (comp.lang.python)
  • Re: debugging
    ... writeson@earthlink.net (Doug Farrell) writes: ... > end up falling back on inserting print statements in my code to figure ...
    (comp.lang.python)
  • Re: How to debug python code?
    ... anyone tell me effective way to debug python code? ... I too rely mostly on unit tests and print statements for debugging, but occasionally I use winpdb which is a pretty nice GUI debugger. ...
    (comp.lang.python)