[Tutor] IDLE not getting changes to imported module

Zak Arntson zak_arntson@hotmail.com
Wed Apr 23 15:13:11 2003

I've got a simple problem, which I'm sure has been answered, but I couldn't 
find the answer at the Tutor archives. I'll pose the problem as a "bug 
report" :)

Problem: IDLE not picking up changes to an imported module

1. A module, main.py, imports another module, thing.py
2. From main.py, I "import module" then "run script"
-- Things work fine --
3. Change and save thing.py
4. From main.py, I "run script"

Expected: Changes made in thing.py are picked up and reflected in step 4.
Actual: Changes made in thing.py are NOT picked up, and the original, 
unchanged version of thing.py is used.

I'm guessing that the original thing.py is stuck in memory, and not updated 
when main.py imports again (with the second "run script"). The only fix I've 
found so far is to restart IDLE everytime I want to run any changes to an 
imported module. But that seems pretty clunky.

Is there some way I can get thing.py's changes to be reflected as soon as I 
save it?

Thanks all,
Zak Arntson

STOP MORE SPAM with the new MSN 8 and get 2 months FREE*