By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,931 Members | 2,015 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,931 IT Pros & Developers. It's quick & easy.

Good examples for Embedding python in C, C++

P: n/a
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

Jul 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a

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

Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.