[Tutor] Is IDLE prone to memory losses ?

Jean Montambeault jrm@videotron.ca
Wed, 12 Dec 2001 12:48:54 +0200

----- Original Message -----
From: <alan.gauld@bt.com>

> Are you by any chance running your script by importing it into
> the interactive window in IDLE?

No, the editing window : most of the time I make my changes, save and run
(ctrl+f5) without experiencing any problem of the sort.

> If so the changes you make in the editor won't show up until
> you reload() the module. That might explain the behaviour you see.
> If I'm right be aware that reload has some quirks to watch out
> for, in particular it only works if you do:
> import foo
> not if you do:
> from foo import *
> Also if you remove a definiton from a loaded module and reload
> the old definition will probably still be there!
> I usually find it easier (ie safer!) to create the module with
> a stanza like:
> if __name__ = "__Main__":
>    # test the program here
> at the end.
> That way I run it from IDLE using the CTRL-F5 key and there are
> no import artifacts left over
> OTOH If you are already doing that then I don't know whats
> happened.
> Alan g.

    That make two of us except that my ignorance is compounded by the fact
that I just don't have a clue about what you all said there. I'll save  it
and come back to it once I'll speak that language.

    Don't stop trying though Alan !

    Thanks. I'm going back to do some basic education now.

    Jean M