Solved Qt use python function return load error
-
I am using QT to call a python function. But the
PyObject* pFunc = PyObject_GetAttrString(pModule, "hello");
if(!pFunc)
{
qDebug() << "GetFunc failed";
}pFunc pointer is NULL, can any help ? thanks.
-
Hi
Try to call
PyObject_HasAttrString
and see what it says. -
This post is deleted! -
@mrjj It returns 0 , but the .py file is simple
def hello():
print("hello world from python"); -
Hi
Is the py file named test ?
https://stackoverflow.com/questions/24313681/pyobject-getattrstring-c-function-returning-null-unable-to-call-python-functi -
@mrjj yes
-
-
@lee64456546
Very bizarre :)