SWIG and Python in use?

Discussion in 'Python' started by Alan Sheehan, Jul 7, 2003.

  1. Alan Sheehan

    Alan Sheehan Guest

    Hi,

    I am considering scripting a large C++ application.

    In particular I am interested in test driving and end-user scripting
    the "application layer" in Python and giving it access to a large
    collection of C++ objects and their methods.

    I note that SWIG is a mature tool and refers to supporting Python
    v1.x.

    Has/Does anyone use SWIG to bind with Python 2.x ?.

    Does it still work?
    Any pitfalls, caveats ?

    Thanks in advance.

    Alan
    Alan Sheehan, Jul 7, 2003
    #1
    1. Advertising

  2. Alan Sheehan

    Wolfgang Guest

    Hi,

    Alan Sheehan wrote:

    > I am considering scripting a large C++ application.
    >
    > In particular I am interested in test driving and end-user scripting
    > the "application layer" in Python and giving it access to a large
    > collection of C++ objects and their methods.
    >
    > I note that SWIG is a mature tool and refers to supporting Python
    > v1.x.
    >
    > Has/Does anyone use SWIG to bind with Python 2.x ?.
    >
    > Does it still work?
    > Any pitfalls, caveats ?


    I've used swig a little bit. It's very good to generate interfaces for
    C librarys. It can build interfaces for a lot of languages not only
    python.

    To interface C++ there are some problems. Simple C++ clases are easy
    to interface but if us use virtual methods, templates an so on that
    possible with swig but you have to write a lot of wrapper code.
    Not an easy task.

    To interface the app to python 2.2 and above, consider to use
    Boost.python: http://www.boost.org/libs/python/doc/index.html

    Today I use Boost.python for my new projects. It's easy
    to interface C++ librarys and all C++ stuff.
    Less code to write and for me it's easier.
    (I don't know the Python C Api in detail, with boost.python
    I wrote a C++ interface for a database within 3 days)


    bye by Wolfgang
    Wolfgang, Jul 8, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jeff
    Replies:
    0
    Views:
    724
  2. Replies:
    1
    Views:
    730
    Chris Lambacher
    Jun 20, 2005
  3. Eric von Horst
    Replies:
    3
    Views:
    824
    Eric von Horst
    Feb 28, 2008
  4. Keith Sabine
    Replies:
    0
    Views:
    579
    Keith Sabine
    Jun 6, 2008
  5. Ivan Muzzolini
    Replies:
    0
    Views:
    95
    Ivan Muzzolini
    Oct 19, 2005
Loading...

Share This Page