Good examples for Embedding python in C, C++

Discussion in 'Python' started by Henko Gouws (H), Apr 28, 2004.

  1. Hallo

    I am looking for good examples on how to call a python script from C,
    C++ and pass parameters (list of strings) to the python script. The
    aim is to ultimately allow the end-user to modify the python script,
    without any code recompilation, to suit the needs of the end-user.
    The C, C++ part will remain intact.

    I could not find good examples, that could help me with this, in the
    references from python.org. I would appreciate your help.

    thanks
    Henko
    Henko Gouws (H), Apr 28, 2004
    #1
    1. Advertising

  2. Henko Gouws (H)

    Rick Ratzel Guest

    I did a presentation on this very topic at PyCon this year:

    http://elmer.sourceforge.net/PyCon04/elmer_pycon04.html

    ...and here is the complete example code:

    http://elmer.sourceforge.net/PyCon04/Elmer_PyCon04.tgz

    You can use Elmer (http://elmer.sourceforge.net) to automatically
    generate the C equivalent to a Python API. When run in "frozen" mode,
    the resulting application is self-contained...but when run in "warm"
    mode, a user can modify the python sources without any code
    recompilation, like you said.

    -Rick Ratzel

    Henko Gouws (H) wrote:
    > Hallo
    >
    > I am looking for good examples on how to call a python script from C,
    > C++ and pass parameters (list of strings) to the python script. The
    > aim is to ultimately allow the end-user to modify the python script,
    > without any code recompilation, to suit the needs of the end-user.
    > The C, C++ part will remain intact.
    >
    > I could not find good examples, that could help me with this, in the
    > references from python.org. I would appreciate your help.
    >
    > thanks
    > Henko
    >
    Rick Ratzel, Apr 28, 2004
    #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. walala
    Replies:
    1
    Views:
    1,225
    Mike Treseler
    Aug 11, 2003
  2. viviane lima - * - * -

    good examples, send links or sources

    viviane lima - * - * -, Jul 31, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    349
    Elliot Rodriguez
    Jul 31, 2003
  3. Dave Smithz
    Replies:
    4
    Views:
    970
    Dave Smithz
    Oct 26, 2004
  4. Kaspar Minosiants

    [REQ] Good source examples of J2EE

    Kaspar Minosiants, Jul 23, 2003, in forum: Java
    Replies:
    0
    Views:
    345
    Kaspar Minosiants
    Jul 23, 2003
  5. nntpman68
    Replies:
    7
    Views:
    608
Loading...

Share This Page