Python interpreter - return JSON created in Python script back to C++ application #4488
Unanswered
luz-arreola
asked this question in
Q&A
Replies: 2 comments
-
I was not able to obtain the json object returned by the python script but it is accessible to my C++ code using pybind11::dict which worked just fine. |
Beta Was this translation helpful? Give feedback.
0 replies
-
you could also do json.dumps(myDict) and then return that as string & load using nlohmann::parse back in to json if ur json had mixt types/etc. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Please bear with me...I've never used Python before. I am currently able to execute the following script from within my C++:
hello.py
I want my C++ code to execute the Python script and for the script to return JSON.
This is what I currently have:
C++ code:
How do I obtain this json from within my C++ application?
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions