Python C extension: Use extension PYD or DLL?

gecco picture gecco · Nov 24, 2011 · Viewed 27.2k times · Source

I have a Python extension written in C and I wonder if I should use the file extension DLL or PYD under Windows. (And what would I use in Linux?)

Are there any differences (besides the filename)?

I found an unofficial article. Is this the secret of pyc? Why can't I find any official article on this topic?

Answer

zchenah picture zchenah · Dec 12, 2011

pyd files are just dll files ready for python importing.

To distinguish them from normal dlls, I recommend .pyd not .dll in windows.

Here is the official doc about this issue:

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