Boost::Python: Dictionary
From Sidvind
|
Importing
Code: Import a dictionary into C++
- object main_module = import("__main__");
- object main_namespace = main_module.attr("__dict__");
Exporting
Code: Export a dictionary from C++
- boost::python::dict createDict(){
- boost::python::dict d;
- d["foo"] = 3.5f;
- d["bar"] = 2.7f;
- return d;
- }