[Numpy-discussion] Numpy and C++ integration...

Ondrej Certik ondrej at certik.cz
Tue Feb 5 05:48:38 EST 2008


On Feb 5, 2008 11:23 AM, David Cournapeau <david at ar.media.kyoto-u.ac.jp> wrote:
> Gael Varoquaux wrote:
> > On Tue, Feb 05, 2008 at 09:15:29AM +0100, Sebastian Haase wrote:
> >
> >> Can ctypes do this ?
> >>
> >
> > No. Ctypes is only a way of loading C (and not C++) libraries in Python.
> > That makes it very simple, but not very powerful.
> >
> I would not call ctypes not very powerful :) For sure you cannot do the
> same way as swig does, but you could imagine some automatic scheme to
> solve Sebastian's problem.
>
> Typically, having a C wrapper automatically generated from the C++
> headers, you could use the ctypes code generator, and you have something
> almost automatic (with a bit some boilerplate code in python, maybe).
>
> cheers,

Also feel free to extend this wiki:

http://wiki.cython.org/WrappingCorCpp

I use Cython, mostly for the same reasons Gael is using ctypes - it's trivial.

Ondrej



More information about the NumPy-Discussion mailing list