AttributeError: 'module' Object Has No Attribute When Trying To Import C Code Into Python
I have an import to import a shared object library created in c. It looks like this: import Cal I then try to make a call in python with the shared object library like so: status
Solution 1:
static PyMethodDef CalMethods[] = {
{"readFile", Cal_readFile, METH_VARARGS},
{NULL, NULL}
};
The Python-visible name you gave your function is readFile
. You need to access it by that name, not Cal_readFile
.
Post a Comment for "AttributeError: 'module' Object Has No Attribute When Trying To Import C Code Into Python"