[Tutor] Up All Night with IDLE.

Tesla Coil tescoil@irtc.net
Sun, 14 Jan 2001 10:06:07 -0600


I'm in IDLE and I write:

def foobar():
    print 'foobar'

foobar()

Save as krock.py, run it, prints foobar.
I return to the editor and modify the function:

def foobaz():
    print 'foobaz'

foobar()

Save, run, prints foobar.

Larger program, more complex functions, awake all night,
rewriting foobaz, mystified that output is still foobar...

Shut down, restart IDLE, reload krock.py run it again:
NameError: There is no variable named 'foobar'

I'll give myself a little credit: I figured it out without that.
I would prefer to get a NameError without shutting down IDLE.
Is there a line I could put at the top of programs to assure
I'll be in uncorrupted namespace on every test run?