View Full Version : SWIG or Ctypes for binding Python to C++
esrix
05-09-2006, 06:32 PM
I was wondering if anyone has used SWIG or Ctypes to bind Pythont to C/C++ and how effective the results were?
I'm thinking of using one of the two along with the Irrlicht engine in order to make a simple game in my free time this summer and I'm looking for any input from people who have used either of them.
HairyTroll
05-09-2006, 06:44 PM
I've used SWIG to generate the Lisp bindings for various libraries (SDL, OpenRM, Cal3D etc.) Works like a charm.
I've had fun with Boost::Python. It works very well.
Rod Hyde
05-10-2006, 06:59 AM
I used SWIG in a project a couple of years ago to write a Python wrapper for PTK. SWIG is very easy to use and you should be able to get results quickly, but the code that it generates is reliable rather than wonderful.
As for ctypes, it will be included in the Python standard library (http://docs.python.org/dev/whatsnew/modules.html#SECTION0001510000000000000000) from version 2.5 onwards. It looks to be sensible enough and I suspect that I'll use it next time I want to access C/C++ from Python.
--- Rod
vBulletin v3.6.0, Copyright ©2000-2008, Jelsoft Enterprises Ltd.