newbieq: IDLE 0.4 question

Jason Trowbridge ratman at nmt.edu
Mon Oct 18 15:11:11 EDT 1999


>From what I understand, Python caches the modules once they're imported
once.  If another module/scope imports that same module, it is given a
shallow copy of the loaded module (much faster & less memory than
loading a completely different copy).

Anyway, to reload the module, you need to call reload():
import mymodule
reload(mymodule)

sep wrote:
> 
> Hi, how do I tell the Python Shell to reload a module after I edit it?
> I do a save in the editor then import module in the shell and the old
> one is still in memory. del module seems to delete it but then import
> module and the old one is there. I know I'm missing something here. I'm
> on NT.
> 
> thanks,
> --
> Sepehr (Sep) Kiani
> ************************************
> skiani at alum.mit.edu
> http://pergatory.mit.edu/skiani
> 
> Sent via Deja.com http://www.deja.com/
> Before you buy.




More information about the Python-list mailing list