I'm really new to C++ and I've come across a problem I've not been able to solve by reading documentations.
I want to embed a script language into my c++ application. That language could be javascript, lua or preferably python.
I'm not looking for something like Boost.Python / swig, something that is able to wrap my c++ functions / classes to a python interface, but rather a python_evaluate_and_return_result_as_variable("my_code");
function.
I have a whole bunch of structs containing a few integers:
struct my_integers {
int a;
int b;
int c;
int d;
int e;
};
Now I want to do some math with these integers, for example:
i.a = i.c * i.e;
The math I want to do will be changing a lot in the future and I need people other then me be able to change the math without having access to the c++ code.
I'm thinking about a code structure like this:
i = my_python_function_cppwrapper(i)
Is something like that possible? I googled a lot for this but the only thing I seem to find are wrappers that provide c++ -> python (or the other way around) functionallity without really interacting with variables.
I'd be really thankful for any help,
Robin.
The Python documentation has a page on embedding Python in a C or C++ application.