can modules be dynamically reloaded

Benjamin Niemann pink at odahoda.de
Wed Nov 16 22:20:45 CET 2005


Steve wrote:

> Can python modules be reloaded.

Yes:

import mymod
...
reload(mymod)

But this will not always work as expected (what someone would expect who
does not really understand how it works...). Read the documentation on
<http://docs.python.org/lib/built-in-funcs.html#l2h-59>

> For example you import a module, programatically edit it, then have the
> file reload the module?
> 
> Does anyone have any ideas about this?
> Steve

-- 
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/



More information about the Python-list mailing list