Can I run a c++ object in Python program?

Daniel Berlin dan at cgsoftware.com
Thu Feb 24 10:23:32 EST 2000


> 
> probably because that instance isn't really PyObject*
> compatible...
> 
> if I were you, I'd wrap the C++ classes using SWIG:
> 
>     http://www.swig.org

Though CXX might be a better fit.
I dunno, i just find it easier for most of my c++ types to use CXX an
create extensions that way, than trying to swigify the headers. Maybe it's
cause i use the STL so heavily. 

In cases where i don't feel like building a C++ class just to expose some
simple type, I create the class in python, and create instances in C++ (I
made an Instance class for CXX taking a class and arguments).
Works great for callbacks.

 > 
> </F>
> 





More information about the Python-list mailing list