Use Python library from C++

zhao bearsprite at gmail.com
Thu Nov 25 01:29:03 EST 2004


Chang LI wrote:
> I want to use the Python Libray from my C++ program.
> The Python Libray is no GUI. How can I mix C++ and
> Python?
>
> One way is to run PY library as an independent process.
> Another way is to start PY as a C++ thread.
> The third way is to run Python engine as part of the C++.
> Which way is better?
>
> No intention to access all the Python's code but only
> access APIs of a module.

Try boost.python and SWIG?
(boost.sourceforge.net, swig.sourceforge.net)

Both provide a interface between C/C++ and python
if you want gui under python, you also can try wxpython or pygtk




More information about the Python-list mailing list