Dynamically reloading extension modules

Tonetheman tonetheman at hotmail.com
Thu Mar 22 00:22:17 EST 2001


Ok, I am an idiot.

Sorry about the last post.

I see that the beos module is only using this to cleanup on exit. I will
have to poke around some more to see how you could get at a del module;

Sorry for the bad advice.


"Ken Seehof" <kens at sightreader.com> wrote in message
news:mailman.985218751.8244.python-list at python.org...
>
> > On Wed, Mar 21, 2001 at 03:36:15PM -0800, Ken Seehof wrote:
> > > Not exactly.  I didn't state the problem very clearly.  The
> > > problem is that while an extension module is loaded, the
> > > module file (pyd on windows) is read-only.
> > >
> > > At least this is true on windows.  On unix, I think maybe you
> > > can rename the module file, rebuild it, and do a reload(module).
> > > Is this true?  Windows doesn't allow you to rename or rewrite
> > > a dll while it is in use, so something like FreeLibrary would be
> > > necessary.
> >
> > Sorry, I can't answer Windows questions. I haven't had to run
> > Windows in years.
> >
> > But I would still think that reload() should work as long as
> > you are using python modules, *not* c/c++ modules.
>
> I -am- talking about c/c++ modules (which I have been referring
> to as "extension" modules).  Hence there's a bit more to it than
> reload().
>
> I want to recompile and reload a c/c++ extension module from
> within a continuously running python program.
>
> > Beazley has no disclaimers about reload working only on
> > specific platforms.
> >
> > There is a caveat, objects created with the old module won't be
> > updated.
>
>
>





More information about the Python-list mailing list