How to pass a arg of object to python's script in a c++ program?

2005-04-26 Thread zghelp
/*I am sorry the prev post is a mistake...*/ //the c++ code using namespace boost::python; struct World { void set(std::string msg) { this-msg = msg; } std::string greet() { return msg; } std::string msg; }; BOOST_PYTHON_MODULE(hello) { class_World(World) .def(greet, World::greet)

Re: How to pass a arg of object to python's script in a c++ program?

2005-04-26 Thread Mike Rovner
Couple notes: - boost.python issues better discuss in comp.lang.python.c++ group; - debug your extension from python first, then embed it - don't call PyFinalize() zghelp wrote: but the exception occur when run to print t.greet() How can I solve it? Providing exception text will be helpful. Mike