I'm trying the embedded python example here:
int
main(int argc, char *argv[])
{
PyObject *pName, *pModule, *pDict, *pFunc;
PyObject *pArgs, *pValue;
int i;
if (argc < 3) {
fprintf(stderr, "Usage: call pythonfile funcname [args]\n");
return 1;
}
Py_Initialize() ;
pName = PyString_FromSt ring(argv[1]);
.....
}
But it seems to break at the line;
pName = PyString_FromSt ring(argv[1]);
it always seems to return null whatever string is used as a parameter?
Can anyone explain or provide a working example?
TIA
int
main(int argc, char *argv[])
{
PyObject *pName, *pModule, *pDict, *pFunc;
PyObject *pArgs, *pValue;
int i;
if (argc < 3) {
fprintf(stderr, "Usage: call pythonfile funcname [args]\n");
return 1;
}
Py_Initialize() ;
pName = PyString_FromSt ring(argv[1]);
.....
}
But it seems to break at the line;
pName = PyString_FromSt ring(argv[1]);
it always seems to return null whatever string is used as a parameter?
Can anyone explain or provide a working example?
TIA
Comment