
8 Sep
2006
8 Sep
'06
8:18 p.m.
Hi, newbie in python and boost::python I have a method in c++ that returns a vector of strings, how can i expose this method in python, and how should i use it in python class A { public: std::vector<std::string> getName(); }; BOOST_PYTHON_MODULE(pysession) { class_<A>("A") .def("GetName" ,&A::getName) } now in python how could i call the function getName() ? here is my error in python TypeError: No to_python (by-value) converter found for C++ type: class std::vect or<class std::basic_string<char,struct std::char_traits<char>,class std::allocat or<char> >,class std::allocator<class std::basic_string<char,struct std::char_tr aits<char>,class std::allocator<char> > > > not valid thanks, Charles.