How do I handle a Python function that returns multiple lists
Python script:
display():
a = [ 'a','b','abc']
b = [ 1 , 2 , 3]
return [a,b]
snippet of the c function calling the above python function:
pValue,pValue1 = PyObject_CallObject(pFunc, pArgs);
Is this the right way to call the function ? But then I cannot use the objects to extract the list values. What am I doing wrong ?
return (a,b)returns a tuple. a single object. in C you are trying to read the results as if it is 2 objects. try returning[a,b]instead. since lists are easier to handle than tuples i think. my c is very rusty.