[Tutor] Converting .pyd to .so

Alan Gauld alan.gauld at btinternet.com
Mon Feb 28 21:29:15 CET 2011


"j ram" <buggyballs at gmail.com> wrote

> 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.

In general you can't use a device driver from one OS on another.
A device driver exposes a set of standard APIs that the OS
expects to find and use to make the device function. But the
way one OS (Windows) interacts with devices is very different
to the way another OS (Linux) will do it so the Windows API
will be completely useless to Linux.

Device drivers are amongst the least portable bits of software
you can create. They can be made portable across compilers
and even across dfferent OS from the same family - you can
often write one device driver for Linux/BSD/MacOS(Darwin)
because they are all flavours of Unix. But unless you are very
lucky a Windows device driver - even if you recompiled the
C code - would be completely useless on Linux.

But as Stefan says, this has now moved to the stage
where it has nothing to do with Python.

-- 
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/




More information about the Tutor mailing list