Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'python.': 0.02; 'python,': 0.02; 'interfaces': 0.04; 'subject:Python': 0.06; 'subject:using': 0.09; 'windows,': 0.09; 'python': 0.11; '2.7': 0.14; "wouldn't": 0.14; 'windows': 0.15; 'dave.': 0.16; 'dll,': 0.16; 'subject:ctypes': 0.16; 'subject:import': 0.16; 'virtualbox': 0.16; 'language': 0.16; 'wrote:': 0.18; 'library': 0.18; 'example': 0.22; 'load': 0.23; 'header:User-Agent:1': 0.23; 'dll': 0.24; 'lets': 0.24; 'header:In-Reply-To:1': 0.27; 'correct': 0.29; 'am,': 0.29; 'possibility': 0.29; "i'm": 0.30; '(usually': 0.31; 'ctypes': 0.31; 'linux.': 0.31; 'probably': 0.32; 'run': 0.32; 'linux': 0.33; 'running': 0.33; 'development.': 0.33; 'actual': 0.34; 'knows': 0.35; 'case,': 0.35; 'but': 0.35; 'version': 0.36; 'whilst': 0.36; 'thanks': 0.36; 'should': 0.36; 'virtual': 0.37; 'application': 0.37; 'to:addr:python-list': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'either': 0.39; 'how': 0.40; 'most': 0.60; "you're": 0.61; "you'll": 0.62; 'email addr:gmail.com': 0.63; 'high': 0.63; 'such': 0.63; 'bridge': 0.65; 'within': 0.65; 'received:74.208': 0.68; 'received:74.208.4.194': 0.84; 'subject:skip:N 10': 0.84; 'wine': 0.91 Date: Tue, 25 Jun 2013 10:05:30 -0400 From: Dave Angel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Unable to import NHunspell.dll using ctypes in Python References: <23e633db-afbe-4edc-9291-5a9e242e86d0@googlegroups.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:LGQTqbZat1R6qCrfQ6Ua+3I1BeLo30Es8h/Xj9GZSkZ kGvAIxE8xaFY3tYKdhMUKx4FDEGbabbfYkvhElrJKxu/SBy3jr Dyj3KnFAZ0Mpre8SMJiM0xCE8Q+uejzcCbcYuITEbBeKNHYHBC C+mSz4EkAwwOflVprB7lWUuzWioShSb3p0Errrw1EmZH0gZNBC VM8ZYhhL9Os5Jpt/0vIAMV4SvCdKn6OTgUCelwt6AHYf0aw2y6 SDtPi1X2unpv3N/GQaYj/KPkpQJWncTh7jbW2UXcVkknoCb3Bx OpbbhVZUdRSI1bqe9odbLRG8jpeiB6yZbwW/unS4BAetKFAFA= = X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 30 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1372169143 news.xs4all.nl 15955 [2001:888:2000:d::a6]:51624 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:49162 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