Re: [C++-sig] create a python object from scratch in boost.python?

2014-01-20 Thread Neal Becker
Gary Oberbrunner wrote: > I'd like to create a python object with some attributes in C++, and return it > to python. Something like this: > > Plugin_Info *pinfo = get_plugin_info_i(i); > bp::object plugin; // this creates None; how can I make an empty class? > plugin.attr("name") =

[C++-sig] create a python object from scratch in boost.python?

2014-01-20 Thread Gary Oberbrunner
I'd like to create a python object with some attributes in C++, and return it to python. Something like this: Plugin_Info *pinfo = get_plugin_info_i(i); bp::object plugin; // this creates None; how can I make an empty class? plugin.attr("name") = std::string(pinfo->plugin_name);