[Tutor] Wrapping C++ in Python?

Daniel Yoo dyoo@hkn.eecs.berkeley.edu
Thu, 22 Mar 2001 20:18:43 -0800 (PST)


On Thu, 22 Mar 2001, Kalle Svensson wrote:

> > I've got some C++ files (a very modest implementation of a an
> > OpenGL-animated world) and I would like to wrap them in Python, so
> > that I can script the actions of players in the world by using
> > Python.
> > 
> > Any pointers on where to start looking?  Docs, etc?
> 
> I've heard that Boost Python is good.
> http://www.boost.org/libs/python/doc/index.html
> 
> There is a tool called SIP, part of PyKDE.
> http://www.thekompany.com/projects/pykde/
> 
> And, of course, a look at the standard documentation is recommended,
> although I think the extending/embedding/api parts are a little weak.
> They are more geared towards C than C++, too.
> http://www.python.org/doc/current/ext/
> http://www.python.org/doc/current/api/


A few more links to recommend:

    http://www.swig.org/

SWIG is supposed to make it easy to write wrappers for Python (and for
many other scripting languages too!)  I've played around with it once, and
found it pretty neat.


Also, if you're doing OpenGL stuff, you might be interested in:

    http://pyopengl.sourceforge.net/

Anyway, good luck to you.