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 diffe
In Windows you can use *.pyd to be imported directly from Python import foo but for *.dll you should use this:
from ctypes import cdll
#load dll file , the file in the same .py file location or enter the full path
mylib=cdll.LoadLibrary("foo.dll")
#call a function from this dll (c-ext)
ReturnedValue=mylib.FunctionName()
If you want to explore what functions are exported in this Dll use this tool
UPDATE: Here's an example using distutils and SWIG to build the extension. Check this article out, it shows many simple examples under Windows and Linux.