"Wayne Watson" <[EMAIL PROTECTED]> 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?

That's very possible. The interpreter will remember its previous state for as long as its running so if you import your module into the shell, say, it will remember it, similarly if you try some code out that uses the same name as the variable in your script it can confuse the interpreter.

That's why, when in doubt, always run your code outside of any IDE to find out its true behaviour. IDEs (including IDLE) are very useful tools but they can mislead as well.

I just inserted the global statement in the full program

I'm not quite sure what you mean by this, but I assume you mean you had a simplified version of the problem plus the full application code that you were working on?

HTH,

--
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to