[Tutor] c++ on python

eryksun eryksun at gmail.com
Fri Mar 7 16:00:26 CET 2014


On Fri, Mar 7, 2014 at 9:29 AM, Gabriele Brambilla
<gb.gabrielebrambilla at gmail.com> wrote:
>
> in the next days  I will receive a c++ code that I would like to run in
> python (http://docs.python.org/2/extending/index.html).
> It should be self consistent (no extraroutines).
> I want to be ready to use it... Has someone some C++ code examples available
> that I can try to run easily before getting that code?

Writing CPython extension modules is probably off topic for
python-tutor. ctypes is on topic, but manually wrapping a C++ library
with a C API that's accessible via ctypes is a lot of work. I
recommend using SWIG or Cython instead.

http://cython.readthedocs.org/en/latest/src/userguide/wrapping_CPlusPlus.html

cython-users forum:
http://groups.google.com/group/cython-users

http://swig.org/Doc2.0/Python.html#Python


More information about the Tutor mailing list