[Tutor] Converting .pyd to .so

Stefan Behnel stefan_ml at behnel.de
Mon Feb 28 08:23:51 CET 2011


fall colors, 28.02.2011 03:25:
 > Stefan Behnel wrote:
>> Well, there's Wine, a free implementation of Windows for Unix systems. You
>> can either try to load the DLL using Wine and ctypes (I suspect that's the
>> hard way), or just run the Windows Python distribution through Wine and load
>> the wrapper .pyd into that.
>>
>> I assume the DLL is only available in binary form?
>>
>>
> Wine is a good suggestion, but it takes up 3.53 MB. Is there a lighter
> alternative?

So far, you didn't state whether the DLL actually uses Windows calls, but I 
would imagine it does, and if so, you can't use it on anything but Windows 
without emulating those calls, thus using Wine.


> The DLL is available in both source and binary form.

If it's available in source form (C? C++? What else?), you can extract the 
part that's interesting to you and wrap that using Cython or ctypes (with 
Cython being substantially faster than SWIG or ctypes).

However, you didn't give us any hints about what the DLL actually does, so 
we can't know if you really need to go that path or if you just failed to 
find the obvious portable alternative.

Stefan



More information about the Tutor mailing list