ctypes - unloading implicitly loaded dlls

pigmartian scottpig1 at comcast.net
Mon Jul 28 21:48:26 EDT 2008

Nick Craig-Wood wrote:

> You could try loading C explicitly with ctypes.LoadLibrary() before
> loading A, then you'll have a handle to unload it before you load B.

I did think of that, but no luck.  Guess the cdll doesn't look for a dll 
loaded already by python.  I guess that does make sense.

> I think I'd probably split the code into two or three processes
> though.  Perhaps use http://pypi.python.org/pypi/processing to
> communicate between them.  That should get you out of DLL Hell!
> (Don't load any of the DLLs before you start the worker processes
> off.)

That was quite a helpful suggestion, thank you.  I had been using the 
subprocess module actually, but really didn't like that approach. 
processing is much nicer.  Pipes, in particular, is quite handy.


More information about the Python-list mailing list