hi
i have an error in script language when run it
i use python 2.4, CentOS 5.5, Qt C++ 2010/04
the error is
SystemError: null argument to internal routine
the Python Code
def main(i):
print i
if __name__ == "__main__":
main(i)
the C++ Code
PyObject *objModule = NULL;
PyObject *objDict = NULL;
PyObject *objExpression = NULL;
PyObject *objArgs = NULL;
objModule = PyImport_AddModule((char*)"__main__");
//pValue = PyInt_FromLong(atoi(cKeyNum));
//objArgs = PyTuple_New(1);
//PyTuple_SetItem(objArgs, 0, pValue);
objArgs = Py_BuildValue("(i)", cKeyNum);
Py_IncRef(objModule);
objDict = PyModule_GetDict(objModule);
objExpression = PyDict_GetItemString(objDict, "main");
//PyCodeObject *objCode = (PyCodeObject *)PyFunction_GetCode(objExpression);
//PyEval_EvalCodeEx(objCode, objDict, NULL, objArgs, 0, NULL, 0, NULL, 0, NULL);
//pValue = PyObject_CallObject(objExpression, objArgs);
PyObject_CallFunction(objExpression, "", cKeyNum);
please help me to fix it