[C++-sig] getting a list of strings from a static method

Josh Stratton strattonbrazil at gmail.com
Thu Aug 25 07:07:39 CEST 2011


I'm very new to boost python and trying to figure out how to properly
get a list of strings from a static method in my main namespace.  I'm
not sure if I need to extract the list from the object or if it's
already a list.

boost::python::object list = exec("Foo.extensions()",
_pyMainNamespace); // where Foo.extensions() is a static method
returning a list of strings

My end goal is to have a QList of QStrings, but if I can somehow get
them to a boost list of std::strings I can take it from there.


More information about the Cplusplus-sig mailing list