[Tutor] Converting .pyd to .so

Stefan Behnel stefan_ml at behnel.de
Mon Feb 28 20:14:15 CET 2011


j ram, 28.02.2011 18:49:
>>> 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.
>
> Sorry for not being more specific, the DLL actually uses Windows calls.
>
>> 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).
>
> The Source is C. I've heard of Cython, would Cython be a more portable
> alternative?

It's likely not more portable than SWIG.


>> 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.
>
> The DLL wraps a device driver, and the library of the SWIG wrapped device
> driver calls is invoked from a Python app. I was trying to find how this
> device driver (DLL) could be used on Linux without having to re-write the
> whole driver code for Linux.

Again, you're not giving us enough information - what kind of device are 
you talking about?

Generally speaking, I doubt that a Windows device driver is of any use on a 
non-Windows operating system. There are exceptions such as NDISWrapper

http://en.wikipedia.org/wiki/NDISwrapper

but they are just that: exceptions. It's hard to emulate enough of the 
Windows driver support layer to make use of a Windows driver.

Anyway, this is no longer a Python problem, so this is getting off-topic 
for this list.

Stefan



More information about the Tutor mailing list