Greetings The task is to call a function from the python script documentCreation.py, located in the same directory as the C ++ executable file. The code below is executed and NULL is written to the pModule variable, that is, the script is not loaded. Assumed that the directory in which the script is not included in the list of sys.path, but Py_GetPath () says the opposite. Tell me how to import the module? System windows 10, python 3.5.2
PyObject *pName, *pModule; Py_Initialize(); pName = PyUnicode_FromString("documentCreation"); pModule = PyImport_Import(pName); //проверяем системные пути python CStringA myConvertedString(Py_GetPath()); cout << myConvertedString; if (pModule == NULL) { cout << "import fail"; } Py_Finalize();