How do I access a variable in C++ that has been wrapped in Python via BoostPython method like below(in this case I want to access y):
boost::python::exec("y = x", main_namespace);
Thanks in advance.
EDIT:
Assume y is an integer.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
All Python classes, functions, variables, etc. are contained in dicts. Since you seem to already have the
main_namespacedict, you can just do this: