Re: How to debug python code?
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

Re: How to debug python code?

From: Thomas Guettler <niemand.leermann@thomas-guettler.de>
Date: Fri Mar 31 2006 - 15:50:47 CEST

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@thomas-guettler.de
Received on Sun Apr 30 21:46:42 2006