I'm calling Python from C++, and trying to perform some data conversions.
For example, if I call the following Python function
def getAMap():
data = {}
data["AnItem 1"] = "Item value 1"
data["AnItem 2"] = "Item value 2"
return data
from C++ as:
PyObject *pValue= PyObject_CallObject(pFunc, NULL);
where pFunc is a PyObject* that points to the getAMap python function. Code for setting up pFunc omitted for clarity.
The returned pointer, pValue is a pointer to a (among other things) Python dictionary. Question is, how to get thh dictionary into a std::map on the C++ side as smoothly as possible?
I'm using C++ Builder bcc32 compiler that can't handle any fancy template code, like boost python, or C++11 syntax.
(Changed question as the python object is a dictionary, not a tuple)