Thursday, October 1, 2009

Debugging Python

The standard python includes includes a debug module : PDB
Python Docs Entry @ doc.python.org

Cheat Sheet

reqd to use the debugger
= import pdb

define breakpoint
= pdb.set_trace()
halts program execution, and drops you into the debugger console

commands available within debugger console
n = execute next line of code, making entire method call
s = execute next line, stepping into any method calls
c = continue to next break point
q = quit
!xxxxx = execute python instruction xxxxx

Tutorials
- Ayman Hourieh Blog Post
- Steve Ferg Blog Post
- SonTek / John Anderson Blog Post

No comments:

Post a Comment

comment: