embedding python in c++: python script not recognized
问题 I am trying to embed python script into c++ project. Below is what I have tried so far. #include<iostream> #include <Python.h> int main() { Py_Initialize(); PyObject* sysPath = PySys_GetObject("path"); PyObject* modPath = PyBytes_FromString("C:\\Users\\naal\\Documents\\Visual Studio 2017\\Projects\\Project1\pyscripts"); int result = PyList_Insert(sysPath,0, modPath); PyObject *pModule = PyImport_ImportModule("myscript2"); printf("%p\n", pModule); return 0; } below is the python script