So i have a c to python wrapper that takes input strings and pass them to a python function. the error im getting is that the python API is not recognizing my python file...
PyObject *pName, *pModule, *pFunc;
QString pyFile="Test.py";
Py_Initialize();
pName = PyUnicode_FromString(pyFile.toAscii().data());
pModule = PyImport_Import(pName);
error is "ImportError: No module named Test.py" This is when i have my Test.py in the same directory as my project
when i placed my Test.py up one level in my directory tree, another error came up error is "Import by filename is not supported"
so i guess absolute paths dont work? but in the first case in my example, i clearly placed my Test.py in the same directory as my project, why am i getting the error? python code is:
import sys
import os
def printFileClass(fileName, className):
print ("The OMC CORBA File name is ", fileName,"\n")
print ("The selected Modelica Class is ", className)
return ("Done operations")
def main():
print ("Hello! Here is testing script's main \n")
if __name__=='__main__':
main()