![]() |
Available news archives:
comp.lang.tcl
-
comp.lang.python
-
comp.security.firewalls
-
sci.crypt -
comp.lang.php -
comp.lang.javascript
|
|
comp.lang.python archiveRe: How to debug python code?
From: <james.wondrasek@gmail.com>
Date: Tue Apr 04 2006 - 01:52:19 CEST
I don't have an example, but what I do is insert:
import pdb
before the code that I think is causing the problem
Then hit 'l' (lowercase L) to get a list of the code
Use 'p' to look at variables. eg p some_local
Use 'n' to execute the current line of code
Use 's' to step through code, including following
Finally, 'c' to continue execution as normal.
There are other options, but that should get you started.
pdb - because fencing off Alaska is too damn slow, binary
jtm
|