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

References <3dade0aa-55ca-4e52-af08-8104e9edf4c3@googlegroups.com> <CANc-5UzOudB6Th34W3BWjkhY-VdLYvnnmux7uQ6ZMYxdN+xAqw@mail.gmail.com>
From Chris Kaynor <ckaynor@zindagigames.com>
Date 2014-08-12 11:55 -0700
Subject Re: Begginer in python trying to load a .dll
Newsgroups comp.lang.python
Message-ID <mailman.12895.1407869744.18130.python-list@python.org> (permalink)

Show all headers | 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