(automatically) reloading changed modules into a running program

Thomas Heller thomas.heller at ion-tof.com
Thu Nov 15 14:32:43 EST 2001


"Thomas Heller" <thomas.heller at ion-tof.com> wrote in message news:9t132f$160s9n$1 at ID-59885.news.dfncis.de...
> I wrote a script which
> - automatically reloads changed modules depending on their timestamp
> - updates existing objects in a running program: classes,
>   functions, bound and unbound methods

Just in case anyone tries this script, there's already a bug.

Please replace these lines

                file = m.__file__
                dirname = os.path.dirname(file)
                path, ext = os.path.splitext(file)

                if ext.lower() == '.py':
                    ext = PY_COMPILED_EXT
                    file = os.path.join(dirname, path + PY_COMPILED_EXT)

with these:

                file = m.__file__
                path, ext = os.path.splitext(file)

                if ext.lower() == '.py':
                    ext = PY_COMPILED_EXT
                    file = path + PY_COMPILED_EXT

Sorry,

Thomas





More information about the Python-list mailing list