[Tutor] Re: using debug

Lee Harr missive at hotmail.com
Sun Aug 10 15:08:22 EDT 2003


>I thought it might be something simple that would help debug a program
>if I was having a problem.
>


I tend to use the "insert print statements around the areas that are giving 
me
problems" style of debugging, but some people prefer the debugger.  You
should try it and see if it works for you.

Here is a quick start:

start IDLE
click File -> New Window
enter a simple program to test the debugger...  let's use this:

# simple.py
for x in range(10):
    print x
    z = 5 * x
    print z
# end simple.py

save the program
click Debug -> Debugger
click Run -> Run Module

To go through your program one statement at a time...
click Step

Now you can follow along in the Debug Control window as your
program runs. You may also want to choose the Source checkbox
so that the current line will be highlighted in the program source
window.

_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE* 
http://join.msn.com/?page=features/virus




More information about the Tutor mailing list