Unable to import NHunspell.dll using ctypes in Python

Dave Angel davea at davea.name
Tue Jun 25 10:05:30 EDT 2013


On 06/25/2013 03:58 AM, akshay.ksth at gmail.com wrote:
> Thanks Dave.
> I'm using Python 2.7 and am working on Linux Mint.
> Does it mean that I cant load the functions within the dll whilst on Linux. I thought that was what ctypes was used for.
>
> Please correct me if I misunderstood what you meant.
>

ctypes is not for cross-platform development, it's for cross-language 
development.  If you have a shared library for your own system whose 
interfaces are designed for a static-typed language (usually C), ctypes 
lets you bridge the gap, and call it from Python.

Your best bet is probably either to find a Windows machine, or to run an 
actual Windows inside a Virtual Box.  I do that whenever I have to 
support an application that's not available for Linux.  In either case, 
you're actually running Windows, so you'll need a Windows python, which 
knows how to call the Windows LoadLibrary and getProcAddress and other 
such OS-specific interfaces.

There's a possibility that running a Windows version of Python under 
WINE will work to access a Windows DLL, but the likelihood is so high 
that there'll be inconsistencies that I wouldn't bother.

VirtualBox and WINE are both available in most Linuxes, for example in 
Synaptic.  And they should also be available via apt-get, but I don't 
know how to find them that way.

-- 
DaveA



More information about the Python-list mailing list