[C++-sig] Could anyone send me an example code for C++/Python Interfacing ???

Billy Gnosis sirbender at freenet.de
Tue Mar 2 19:30:06 CET 2004


Hi...


I am writing plugins for an already existing application. An API is 
supplied in C++ to "interact" with the necessary parts of the application.

I have written a Pthon programm that does some text parsing tasks and 
returns a some lists and an Nnumeric array as the desired result.

Now I would like to _call _this Python program from within my C++ plugin 
_with a single argument:_    _a filename_. The Python program now should 
do the Text processing trick and_ return the lists (could convert to 
Numeric arrays before, if it helps) and arrays to the C++ programm_. 
(optimally this should happen without the user knowing that python is 
working partially in the background - no Dos Box opening etc.).

I have underlined the parts of the process in the text above I don't 
know how to do...I hope there is a simpler solution than using a neat 
interfacing support  like SWIG etc...

Now, I want to ask somebody if he perhaps has a little SIMPLE example 
code in C++ and Python where something similar is done. I would 
appreciate some example files very much,  as I could then directly test 
out what's going on.
Surely I am also very happy with any other counsel...

Thanks,

billy





More information about the Cplusplus-sig mailing list