[C++-sig] embedded Python: Access an object defined previously in C++

Markus Heller markus at relix.de
Thu Dec 22 17:17:33 CET 2005


Dear List,

I intend to execute a Python script from within a C++ program. I have already 
managed to embed Python and execute a simple program line. 

Though, I have a complex data object in C++, which I don't want to serialize, 
write out to a file in order to read it in again. I would preferably like to 
define a Python object from within C++ and hand over this data structure 
directly. 

Unfortunately the Python/C API Reference Manual doesn't offer any precise 
help. It is more like a manual for experts, not a guide to beginners like 
me... 

So do you have any hint for me? Where can I get some more information? As 
said, I want to create a Python object in C++ and use it in Python 
afterwards. 

Thanks in advance,

Markus




More information about the Cplusplus-sig mailing list