forcing future re-import from with an imported module

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Wed Dec 10 07:46:53 EST 2008


En Tue, 09 Dec 2008 23:27:10 -0200, _wolf <wolfgang.lipp at gmail.com>  
escribió:

> how can i say, approximately, "re-import the present module when it is
> imported the next time, don’t use the cache" in a simple way? i do not
> want to "reload" the module, that doesn’t help.

I'd say you're using modules the wrong way then. The code inside a module  
is executed *once*, and that's by design. If you want to execute something  
more than once, put that code inside a function, and call it as many times  
as you want.

-- 
Gabriel Genellina




More information about the Python-list mailing list