reloading modules

Thomas Heller theller at python.net
Mon Jul 1 06:09:21 EDT 2002


"Jeff Davis" <jdavis at empires.org> wrote in message news:1FVT8.56956$xy.18941573 at twister.socal.rr.com...
>
> It seems like it might be common to import a module (that may or may not
> have already been loaded) and require that you get the newest version at
> the time of the import.
>
> The way I see it, this requires 3 steps:
> 1) build a table of the modification times of files that have been imported
> 2) compare a file's modification time to the time stored in the table
> 3) import the module if it doesn't exist in the table, do nothing if the
> modification times are the same, and reload it if the modification times
> are different.
>
> My question is: are the python developers planning on including such a
> standard function at some furture time, or should I just plan on having my
> own module for that? Or does a 3rd party one exist?
>
> Thanks,
>         Jeff
I've posted a script doing this (and more) some time ago.
Here's a pointer:

http://groups.google.com/groups?selm=9t132f%24160s9n%241%40ID-59885.news.dfncis.de

Thomas





More information about the Python-list mailing list