Unload extension modules when python22.dll unloads... [using C extension interpreter]

Anand anand_soliton at yahoo.com
Thu Nov 6 12:31:54 EST 2003


I have a unexpected issue with python modules (well i kind of know
why, but i am trying to find if there is a way around)

Intro:
I am allowing an external application to actually run python scripts.
The external application i am taking about is a test sequencer with a
lots of functionality. So the external application has a lot of gui
and all the testing logic is done in python. Things work fine when i
run regular code and i have been running python code successfully
(several thousand lines of code) for over eight months.

Issue:
      Well, now there is an requirement to throw a dialog box from
python. I built a wxpython code and was able to successfully show the
dialog box from python. But when i run the code for the second time,
it wouldnt work..

the wxpython's dll probably does some initialization during
dll_process_attach... but i never see the pyd get unloaded ( i
actually unload python22.dll after each run). this is a big problem
now. i did not really consider about this earlier. so i cannot
actually Guarantee proper fuctioning of the python code...

is there a way for me to *unload dynamically loaded extension module*
each time and then reload it each time when the code is called...

thanks a lot in advance.




More information about the Python-list mailing list