I am basically looking to see if it's possible to compile Python code into a C++ program such that a single binary is produced, then call the (compiled) python code as/with a function from within the C++ code.
Background: I have a C++ code that does some work and produces data that I want to plot. I then wrote a seperate Python script using SciPy that reads in the output data, processes it, and plots it to files. This all works as it is.
Basically, I am picturing:
void plotstuff() {
my_python_func(); // This is the python script compiled into the c++ binary
}
I don't need to pass anything between the python code and the C++ code other than being sure it's executed in the same directory. It may make things easier if I can pass string arguments, but again - not essential.
Can this be accomplished? Or is it generally a bad idea and I should just stick to having my C++ and python separate?