Newbie IDLE - import issues

Tim Roberts timr at probo.com
Thu Nov 28 01:05:23 EST 2002


Kenny Tilton <ktilton at nyc.rr.com> wrote:

>I must misunderstand things badly.
>
>Using IDLE: I have import statements where apparently necessary. I hit 
>Ctrl-F5 and I see print statements at the end of imported modules fire.
>
>But I still get errors on imported stuff being undefined.
>
>Then I open the imported file and ^f5 it and then I can ^f5 successfully 
>the importing file which before gave me an error.
>
>any help with this would be appreciated. As is I end up having to open 
>ten files and run them manually every morning.

Remember that an IDLE session is one big, long run of the interpreter.

A given module is only imported once.  Once it has been imported, Python
remembers that, and any subsequent imports become no-ops.

You can use "reload" to force another actual load.
--
- Tim Roberts, timr at probo.com
  Providenza & Boekelheide, Inc.



More information about the Python-list mailing list