April 24, 2010: We are pleased to announce that Version 4 of this course is now under development. For updates and an early peek at the content, please check out the Software Carpentry blog at http://www.software-carpentry.org/blog/.
Figure 5.1: A Debugger in Action: Debug I/O Panel
Figure 5.2: A Debugger in Action (2): Stack Data Panel
Figure 5.3: Source Browser: Functions
pdb
pdb.set_trace() inside a programset-trace.py: import pdb base = "Na" pdb.set_trace() acid = "Cl" salt = base + acid print salt
user@user-desktop:~$ python set-trace.py
> /home/user/set-trace.py(7)<module>() -> acid = "Cl" (Pdb) n > /home/user/set-trace.py(8)<module>() -> salt = base + acid (Pdb) n > /home/user/set-trace.py(9)<module>() -> print salt (Pdb) n NaCl --Return-- > /home/user/set-trace.py(9)<module>()->None -> print salt (Pdb) n
2*x<0, debugger displays False
Figure 5.4: Inspecting Values
Figure 5.5: Programs As Data
max_temp to -1)time_spent_waiting to 600 seconds in debugger than to pull out the network cable and wait...Noneassert to check things that ought to be right
Copyright © 2005-09 Python Software Foundation.
Created Thu Aug 6 21:56:06 2009 UTC