Extend&Embed : how to pass user-defined object to scripts

Oscar ro4tub at gmail.com
Fri Jan 13 14:36:02 EST 2006


/// Foo.cpp
class CFoo
{

};


# Test.py
#i use foo.cpp build the 'foo' module
import foo

#param : CFoo
def bar(o):
     #call the object o's member functions


at last,i call the bar() function in my main.cpp.
///main.cpp
CFoo foo;
/// how to pass foo to the function 'bar'


now, i use the binder 'boost::python'.




More information about the Python-list mailing list