[C++-sig] problem using python as library code called from C++

Liang, James jliang at sandia.gov
Tue May 25 19:53:06 CEST 2004


Hi,

I have an existing C++ program that I'd like to extend by using Python.
Ideally, I would like to call an init function to initialize
Python-side data structures, and then simply call Python functions as though
they were library functions from some other C++ module.

What is the most appropriate way to do this?  

I've seen references to PyObject_CallObject, but I don't know how to get a
pointer to a function object.  None of the PyRun_XX commands 
seem return the pointers I need.   What should I do?

I've already gone through the docs at 

http://www.python.org/doc/2.3.3/api/api.html , but can't find the one I
need.   Suggestions?


James 





More information about the Cplusplus-sig mailing list