I have been able to find out a few things I know that you need to include Python.h and that you need to have
Py_Initialize();
//code that runs the python sc
The easiest way to run a Python script from within a C++ program is via PyRun_SimpleString(), as shown in the example at this web page:
#include
int main(int argc, char *argv[])
{
Py_SetProgramName(argv[0]); /* optional but recommended */
Py_Initialize();
PyRun_SimpleString("from time import time,ctime\n"
"print 'Today is',ctime(time())\n");
Py_Finalize();
return 0;
}
If you want to run a script that's stored in a .py file instead of supplying the Python source text directly as a string, you can call PyRun_SimpleFile() instead of PyRun_SimpleString().