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


Groups > comp.lang.python > #76137

Re: Begginer in python trying to load a .dll

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <ckaynor@zindagigames.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.002
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'api.': 0.05; 'classes,': 0.05; 'compiler': 0.07; 'scheme.': 0.09; 'subject:trying': 0.09; 'to:addr:pobox.com': 0.09; 'to:addr:skip': 0.09; 'cc:addr:python- list': 0.11; 'python': 0.11; 'changes': 0.15; 'compiler.': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'written': 0.21; 'aug': 0.22; 'cc:addr:gmail.com': 0.22; 'handles': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**1': 0.23; 'accommodate': 0.24; 'dll': 0.24; 'library,': 0.24; 'skip': 0.24; 'subject: .': 0.24; 'second': 0.26; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'chris': 0.29; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; 'easier': 0.31; '(possibly': 0.31; 'ctypes': 0.31; 'minor': 0.31; 'interface': 0.32; 'maybe': 0.34; 'received:74.125.82': 0.34; 'received:google.com': 0.35; 'c++': 0.36; 'should': 0.36; 'little': 0.38; 'received:74.125': 0.39; '12,': 0.39; 'how': 0.40; 'new': 0.61; 'name': 0.63; 'different': 0.65; 'typically,': 0.84; 'directly.': 0.95
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=GBWdAE5tlceTTDJETYj2ActlqvAkBeHyghNA5PTUiPk=; b=Z2SjM5bVtOBmTfDwtHqa41a1job2WHIz24MNhQWxoE8lC1aN3ekpF0r5FCyVrAmpKa FWq7M+Wm6xCCykINxYJFSWvOCLW6ww72GvPX6337N9Vtvp/VZLOuglh35DZSY9OBn4Jv Oh3MyKkcH97RXpmtdE8KiD+wLRt9c+Pxm3p1MdCL1LzTFzndVRdhBkGBw7PiY1Ejez4v J/vW4PI39iRAGmqkhrQHJy3fFlYjZoreklYZZHH9D1QLxB4cKLZ6+1H9wegCWEclUbnR UbW/zoI5ZF0PMscmamKzuefaSVKWmwV/0JbU5E4u+I4d8dECXKZtPbSHVsrVfnq2lZd9 Vx1A==
X-Gm-Message-State ALoCoQkJQ+Ke9w8S92YSqm/6bLEEAgL3N/ql+dDebJv/6HAm8CMN/TwFl90L/DkZTaJG2d1/tvSX
X-Received by 10.180.205.168 with SMTP id lh8mr411649wic.33.1407869734741; Tue, 12 Aug 2014 11:55:34 -0700 (PDT)
MIME-Version 1.0
In-Reply-To <CANc-5UzOudB6Th34W3BWjkhY-VdLYvnnmux7uQ6ZMYxdN+xAqw@mail.gmail.com>
References <3dade0aa-55ca-4e52-af08-8104e9edf4c3@googlegroups.com> <CANc-5UzOudB6Th34W3BWjkhY-VdLYvnnmux7uQ6ZMYxdN+xAqw@mail.gmail.com>
From Chris Kaynor <ckaynor@zindagigames.com>
Date Tue, 12 Aug 2014 11:55:14 -0700
Subject Re: Begginer in python trying to load a .dll
To Skip Montanaro <skip@pobox.com>
Content-Type multipart/alternative; boundary=001a11c38ace6dfd9205007337d8
Cc c1223 <camilocelyg@gmail.com>, Python <python-list@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.12895.1407869744.18130.python-list@python.org> (permalink)
Lines 55
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1407869744 news.xs4all.nl 2922 [2001:888:2000:d::a6]:44209
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:76137

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

On Tue, Aug 12, 2014 at 11:48 AM, Skip Montanaro <skip@pobox.com> wrote:

> Just as the off-chance your DLL was written in C++... I don't think
> you can interface with ctypes directly. I think you would have to
> write a little shim DLL which exposes a C-compatible API.
>

You should be able to use ctypes with a C++ library, you'd just need to
know how your C++ compiler handles name mangling. Typically, changes are
made to accommodate classes, namespaces, and function overloads. Of course,
if you were to change to a different compiler (possibly including a
different version) or made minor tweaks to the functions, you'd have to
update all the Python code to use the new name mangling scheme.

Hmm...On second thought, maybe just only using functions exports with
"extern C" would be easier - or just using a C compiler.

Chris

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


Thread

Begginer in python trying to load a .dll c1223 <camilocelyg@gmail.com> - 2014-08-12 11:36 -0700
  Re: Begginer in python trying to load a .dll Chris Angelico <rosuav@gmail.com> - 2014-08-13 04:44 +1000
  Re: Begginer in python trying to load a .dll Skip Montanaro <skip@pobox.com> - 2014-08-12 13:48 -0500
  Re: Begginer in python trying to load a .dll Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-08-12 19:52 +0100
  Re: Begginer in python trying to load a .dll Chris Kaynor <ckaynor@zindagigames.com> - 2014-08-12 11:55 -0700
  Re: Begginer in python trying to load a .dll c1234 py <camilocelyg@gmail.com> - 2014-08-12 11:56 -0700
    Re: Begginer in python trying to load a .dll Rob Gaddi <rgaddi@technologyhighland.invalid> - 2014-08-12 11:58 -0700
      Re: Begginer in python trying to load a .dll Chris Angelico <rosuav@gmail.com> - 2014-08-13 05:09 +1000
        Re: Begginer in python trying to load a .dll c1234 py <camilocelyg@gmail.com> - 2014-08-12 12:13 -0700
          Re: Begginer in python trying to load a .dll Laurent Pointal <laurent.pointal@laposte.net> - 2014-08-19 18:44 +0200
            Re: Begginer in python trying to load a .dll "ElChino" <elchino@cnn.cn> - 2014-08-19 19:46 +0200
  Re: Begginer in python trying to load a .dll Christian Gollwitzer <auriocus@gmx.de> - 2014-08-12 21:16 +0200
    Re: Begginer in python trying to load a .dll c1234 py <camilocelyg@gmail.com> - 2014-08-12 12:25 -0700
      Re: Begginer in python trying to load a .dll Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-08-12 21:17 +0100
        Re: Begginer in python trying to load a .dll c1234 py <camilocelyg@gmail.com> - 2014-08-13 08:25 -0700

csiph-web