[Tutor] Local Unbound Mystery

Kent Johnson kent37 at tds.net
Sat Sep 20 14:32:02 CEST 2008


On Sat, Sep 20, 2008 at 7:26 AM, Wayne Watson
<sierra_mtnview at sbcglobal.net> wrote:

> I do not think I've made an inaccurate observation. Is it possible the IDLE
> shell is leaving something behind that I can't see? Maybe I had two shell
> window up at the same time between the real and debug program.

I'm not too familiar with IDLE but the version I have does have this
behaviour- if I run a program that defines global variables, then the
globals are available in the shell until I run another program. So if
you are switching between running a program and experimenting in the
shell, that may cause you some confusion.

I don't think IDLE preserves variables between runs of a program. When
the shell prints out the "RESTART" line, it is clearing the old
variables.

Whether that is the problem or not, I recommend you find a different
editor or IDE to use; IMO IDLE is quite primitive and there are many
better choices. Check the list archives or the Python wiki for many
suggestions.
http://wiki.python.org/moin/PythonEditors

Kent


More information about the Tutor mailing list