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

Markus Heller markus at relix.de
Fri Dec 23 05:05:57 CET 2005


Dear Stefan,

> > You see, I have a rather big struct in my C++ memory and I want to retain
> > a certain flexibility and give the users of my application the chance to
> > do some customized data processing. To me the ideal way is to offer them
> > access to the data through python.
>
> Ok, I was misled by your phrasing then, sorry. It seems you really want
> to reflect your C++ type(s) into python, using boost.python's class_
> mechanism.
> That is described rather well in the above docs, I think. May be you
> could ask more specific questions once you run into difficulties, sending
> code snippets, error messages, and the like ?
> Or, a *concrete* example of what you want to do, i.e. how the C++ type
> looks like, and how you want it to look like in python, etc.

I restructured my code for performance issues, and now I have a smaller and 
simpler struct, containing two individual strings (STL strings) and a vector 
of strings. 

The individual strings should not be a problem, I assume, and the vector of 
strings is actually a tuple. But the problem is more that I am not so 
proficient in python at all. I think, I will consider your hints in depth and 
come back once I can send you more qualified utterances on this wonderful 
scripting language :-)

Thanks a lot!!

Markus




More information about the Cplusplus-sig mailing list