Archive for the ‘C++’ Category

Boost::python str to std::string

As with everything in Boost::Python, it might not always be obvious how to best extract certain types to C++ One thing to remember is that most (if not all) C++ types are supported by boost::python::extract So, to extract a std::string object from python, it’s best to use the extract function again: std::string tmp; tmp = [...]

Read the rest of this entry »

boost::python iterating over dictionaries

When working with boost::python, it’s quickly noticeable the lack of documentation involved in integrating Python in a C++ application, however using boost::python is a lot easier then using the normal Python/C API so it’s recommended to whomever considers using Python in a C++ application. Tricky The downside of it is the lack of examples, and [...]

Read the rest of this entry »