Importing is partially working...

Steven D'Aprano steve at pearwood.info
Mon Aug 10 22:40:42 EDT 2015


On Tue, 11 Aug 2015 01:48 am, MRAB wrote:

> On Windows, the extension for Python extension DLLs is ".pyd".

I believe that there is a subtle difference in the entry-point depending on
whether the file is named .pyd or .dll.

http://effbot.org/pyfaq/is-a-pyd-file-the-same-as-a-dll.htm
https://docs.python.org/2/faq/windows.html#is-a-pyd-file-the-same-as-a-dll

I'm not entirely sure, but I think the only way to access a DLL proper is
via cytpes (or some other third-party framework, like Boost or SWIG). To
actually use "import spam" on a DLL, you have to make sure it has an
initfoo() function, and declare the list of available functions somewhat
differently.

Oh, and according to this:

https://docs.python.org/2/extending/windows.html

prior to Python 2.5, spam.dll was recognised by import. That was
specifically changed so that you could have a spam.dll C library and a
spam.pyd interface to that library.



-- 
Steven




More information about the Python-list mailing list