SWIG or Ctypes for binding Python to C++

Discussion in 'Game Development (Technical)' started by esrix, May 10, 2006.

  1. esrix

    Original Member

    Joined:
    Aug 11, 2005
    Messages:
    143
    Likes Received:
    0
    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.
     
  2. HairyTroll

    Original Member

    Joined:
    Jul 29, 2004
    Messages:
    582
    Likes Received:
    0
    I've used SWIG to generate the Lisp bindings for various libraries (SDL, OpenRM, Cal3D etc.) Works like a charm.
     
  3. mot

    mot
    Indie Author

    Joined:
    Oct 21, 2004
    Messages:
    439
    Likes Received:
    0
    I've had fun with Boost::python. It works very well.
     
  4. Rod Hyde

    Original Member

    Joined:
    Jul 27, 2004
    Messages:
    123
    Likes Received:
    0
    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 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
     

Share This Page

  • About Indie Gamer

    When the original Dexterity Forums closed in 2004, Indie Gamer was born and a diverse community has grown out of a passion for creating great games. Here you will find over 10 years of in-depth discussion on game design, the business of game development, and marketing/sales. Indie Gamer also provides a friendly place to meet up with other Developers, Artists, Composers and Writers.
  • Buy us a beer!

    Indie Gamer is delicately held together by a single poor bastard who thankfully gets help from various community volunteers. If you frequent this site or have found value in something you've learned here, help keep the site running by donating a few dollars (for beer of course)!

    Sure, I'll Buy You a Beer