I wrote a C# library in linux with .NET Core. Now I want to use it in python. Has someone experience with this topic? Is this even possible?
I tried to use
import ctypes as ct
lib = ct.WinDLL("PythonTest.dll")
but I run in this error
Traceback (most recent call last):
File "<input>", line 1, in <module>
AttributeError: 'module' object has no attribute 'WinDLL'
Please see the documentation
On Linux, it is required to specify the filename including the extension to load a library, so attribute access can not be used to load libraries. Either the LoadLibrary() method of the dll loaders should be used, or you should load the library by creating an instance of CDLL by calling the constructor:
WinDLL() is for Windows on Linux you need to use .LoadLibrary() or CDLL()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With