I have written a program which has a few cpp, python source files and csv files which are used for input and output between programs(one program file generates a .csv for input to another program file). The user additionally has to write 3 csv files as input to the whole program as a start as these inputs are huge since its a timetable generator program, which needs the university data as initial input. Can I make an executable out of this program structure?
Asked
Active
Viewed 602 times
2
-
Do you mean like `pyInstaller`? – Tom Myddeltyn May 12 '16 at 19:44
-
@user348752, Do you mean like an installation - msi package? Are you calling python script from the C++ code or vice versa? – Igor May 12 '16 at 19:56
-
I'm calling the whole sequence of programs in a bash script. – zeus May 13 '16 at 03:49
-
Sorry, forgot to mention that in the question – zeus May 13 '16 at 04:05
1 Answers
0
You can compile and link all cpp
file into a single executable and also embed your python file in this program using Python C API.
#include <Python.h>
int main(int argc, char *argv[])
{
Py_Initialize();
PyRun_SimpleString("This is the content of your python files");
Py_Finalize();
return 0;
}
You can also compile your static csv files as long strings or resource files inside the executable.