Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #49162

Re: Unable to import NHunspell.dll using ctypes in Python

Date 2013-06-25 10:05 -0400
From Dave Angel <davea@davea.name>
Subject Re: Unable to import NHunspell.dll using ctypes in Python
References <23e633db-afbe-4edc-9291-5a9e242e86d0@googlegroups.com> <bfa57c71-14f9-4c09-8cdb-a56b1f746340@googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.3831.1372169143.3114.python-list@python.org> (permalink)

Show all headers | View raw


On 06/25/2013 03:58 AM, akshay.ksth@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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Unable to import NHunspell.dll using ctypes in Python akshay.ksth@gmail.com - 2013-06-24 23:23 -0700
  Re: Unable to import NHunspell.dll using ctypes in Python Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-06-25 08:07 +0100
    Re: Unable to import NHunspell.dll using ctypes in Python akshay.ksth@gmail.com - 2013-06-25 00:32 -0700
      Re: Unable to import NHunspell.dll using ctypes in Python Dave Angel <davea@davea.name> - 2013-06-25 03:45 -0400
      Re: Unable to import NHunspell.dll using ctypes in Python Chris “Kwpolska” Warrick <kwpolska@gmail.com> - 2013-06-25 09:54 +0200
      Re: Unable to import NHunspell.dll using ctypes in Python Dave Angel <davea@davea.name> - 2013-06-25 09:55 -0400
  Re: Unable to import NHunspell.dll using ctypes in Python akshay.ksth@gmail.com - 2013-06-25 00:58 -0700
    Re: Unable to import NHunspell.dll using ctypes in Python Dave Angel <davea@davea.name> - 2013-06-25 10:05 -0400
  Re: Unable to import NHunspell.dll using ctypes in Python akshay.ksth@gmail.com - 2013-06-25 01:04 -0700
    Re: Unable to import NHunspell.dll using ctypes in Python Chris “Kwpolska” Warrick <kwpolska@gmail.com> - 2013-06-25 10:32 +0200
  Re: Unable to import NHunspell.dll using ctypes in Python akshay.ksth@gmail.com - 2013-06-25 07:52 -0700

csiph-web