Loading C module under WinNT

Fredrik Lundh effbot at telia.com
Wed Feb 9 13:41:57 EST 2000


sirotenko at fnal.gov wrote:
> I am running Python 1.5.2 on Windows NT. I have my C module, ca,
> compilled and build as dll.
> 1) if the name of the DLL is camodule.dll, I can not load it
> with import ca, I have ImportError: module is not found
> 2) if the name of DLL is ca.dll - it works ok.
> The problem is that I already has ca.dll from other vendor and my
> package is using that ca.dll, so I must
> use name different from ca.dll, otherwise python gets confused.
> On unix camodule.so works ok, does anyone knows why it does not work
> on Windows NT? Thanks a lot,

because Python doesn't look for <name>module.so on
Windows. however, you can use <name>.pyd instead.
just do:

    > rename ca.dll ca.pyd

and everything should work just fine.

(you can use imp.get_suffixes() to get a list of all module
suffixes supported on your platform).

</F>

> Sent via Deja.com http://www.deja.com/

argh!





More information about the Python-list mailing list