tags:

views:

42

answers:

1

I want to use c++ load py.

But one of parameters of a function is dict.

So, can I pass the map in C++ to dict in py?

+1  A: 

Your problem description is a little terse. If I understand correctly though, you'd like to embed a Python interpreter within a C++ application and, from C++, you want to be able to instruct the interpreter to load Python modules. If this is correct, then the answer is no. The Python C API expects a Python object whenever a dict is required. If you wish to use a C++ map, you'll have to use the Python C API and manually manage the coversion between the keys & values.

Depending on your needs, the Boost.Python library may be able to simplify some of the cross-language code for you.

Rakis
Thanks a lot!I wrote so short because my english is poor. I am very sorry for that.
Begtostudy