python/C++ wrapper

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Frank

    #1

    python/C++ wrapper


    Hi,

    is there anyone here that calls C++ programs from python via swig? It
    seems that there are a lot of different ways to do that. For me it
    would be important that the original c++ code (which is available)
    does not need to be changed and the whole compilation process (swig -
    python.... g++....etc) is as simple as possible.

    Does anyone have a running example of the following problem:

    - A c++ program receives a 2D-matrix from python as input and gives a
    2D-matrix as output back to python.

    That's all! I would expect there should be someone who actually uses
    swig for this kind of problem. If so, could you send me the code, that
    would be great!

    If it is important, I use linux and numpy.

    Thanks,

    Frank

  • Roman Yakovenko

    #2
    Re: python/C++ wrapper

    On 13 Mar 2007 21:55:55 -0700, Frank <supervau@gmail .comwrote:
    >
    Hi,
    >
    is there anyone here that calls C++ programs from python via swig? It
    seems that there are a lot of different ways to do that. For me it
    would be important that the original c++ code (which is available)
    does not need to be changed and the whole compilation process (swig -
    python.... g++....etc) is as simple as possible.
    >
    Does anyone have a running example of the following problem:
    >
    - A c++ program receives a 2D-matrix from python as input and gives a
    2D-matrix as output back to python.
    >
    That's all! I would expect there should be someone who actually uses
    swig for this kind of problem. If so, could you send me the code, that
    would be great!
    If this is all you need, than may be you don't need to use any code
    generator, but try
    some other way: Boost.Python. Take a look on tutorials:



    --
    Roman Yakovenko
    C++ Python language binding

    Comment

    • Szabolcs Nagy

      #3
      Re: python/C++ wrapper

      - A c++ program receives a 2D-matrix from python as input and gives a
      2D-matrix as output back to python.
      pyogre uses swig

      ogre is a 3d realtime rendering engine written in c++ so there are
      many matrix manipulation there and also pyogre does not modify the
      original code

      cgkit is a computer graphics toolkit written in c++ for python and it
      uses boost-python and it uses matrices as well

      if you want matrix manipulations in python then you may want to look
      into numpy c api

      Comment

      • Roman Yakovenko

        #4
        Re: python/C++ wrapper

        On 14 Mar 2007 02:38:32 -0700, Szabolcs Nagy <nszabolcs@gmai l.comwrote:
        - A c++ program receives a 2D-matrix from python as input and gives a
        2D-matrix as output back to python.
        >
        pyogre uses swig
        Well, pyogre has few problems with maintenance, and new bindings to
        Ogre engine was
        created using Boost.Python( http://www.ogre3d.org/wiki/index.php/PyOgre )

        --
        Roman Yakovenko
        C++ Python language binding

        Comment

        • Szabolcs Nagy

          #5
          Re: python/C++ wrapper

          Well, pyogre has few problems with maintenance, and new bindings to
          Ogre engine was
          created using Boost.Python( http://www.ogre3d.org/wiki/index.php/PyOgre )
          oh
          last time i played with pyogre they made a transition from boost to
          swig :)
          so they are back again at boost
          (the problem with boost was the slow recompilation time with all the
          gccxml parsing and a few other problems which maybe got resolved)
          --
          Roman Yakovenko
          C++ Python language binding
          http://www.language-binding.net/
          thanks for the info this py++ looks promising

          Comment

          • John Pye

            #6
            Re: python/C++ wrapper

            Check out this example from NumPy. This would be the way sanctioned by
            the scipy community, as you benefit from a large library of matrix
            routines that you can use to prepare/postprocess the data.




            Comment

            • Gabriel Genellina

              #7
              Re: python/C++ wrapper

              En Wed, 14 Mar 2007 01:55:55 -0300, Frank <supervau@gmail .comescribió:
              is there anyone here that calls C++ programs from python via swig? It
              I suggest you read the responses to your previous question; also search
              the list archives for this month.

              --
              Gabriel Genellina

              Comment

              • Frank

                #8
                Re: python/C++ wrapper

                On Mar 14, 1:42 pm, "Gabriel Genellina" <gagsl-...@yahoo.com.a r>
                wrote:
                En Wed, 14 Mar 2007 01:55:55 -0300, Frank <super...@gmail .comescribió:
                >
                is there anyone here that calls C++ programs from python via swig? It
                >
                I suggest you read the responses to your previous question; also search
                the list archives for this month.
                >
                --
                Gabriel Genellina

                Hi Gabriel,

                and I suggest you read the question I asked precisely!

                Frank

                Comment

                Working...