Python interpreter - pass c++ arguments to python script #4487
Unanswered
luz-arreola
asked this question in
Q&A
Replies: 1 comment
-
Looking through the pybind11 docs and spending several hours learning some basic python, I can now pass arguments directly to a python script with pybind::dict. I was really hoping to be able to do so using pybind::list which is somewhat similar to std::vector but found no way to refer to it from within inside the python script. The dict works just fine though. |
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.
-
Using 'embedded python', I can currently execute a python script:
C++ code:
The following python script file is properly executed:
hello.py
QUESTIONS:
How do I pass one or more arguments from my C++ application to be made available and used by the Python script?
How do I pass a std::vector from my C++ application to be made available to the Python script? For example:
std::vector<std::string> args = {"arg 1", "arg 2", "arg 3"};
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions