Invoking python through C++: How to?

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Tue Sep 25 23:12:58 EDT 2007


En Tue, 25 Sep 2007 14:10:49 -0300, Robert Dailey <rcdailey at gmail.com>  
escribi�:

> I have a python script that I would like to invoke through my C++
> application. Does anyone know of a trivial way of doing this? Right now  
> the
> only idea I can come up with is using system("python myscript.py") in  
> C++.

If you don't want to "share" objects between Python and C++, that's the  
simplest way.
Or, look at the document "Extending and Embedding the Python Interpreter"  
<http://docs.python.org/ext/ext.html>

-- 
Gabriel Genellina




More information about the Python-list mailing list