P
pieter
I want to use a Python function that returns a double array in C++.
I don’t have a problem if the Python function returns a single
variable of type double, using the following lines in my C++ code:
myPythonObjectPointer = PyObject_CallObject(pFunc, pArgs);
myCppDoubleVariable = PyFloat_AsDouble(myPyObjectPointer);
(I have obviously done all the required thingies to embed Python in C+
+ as per the Python documentation)
I can achieve what I want by changing the Python function to a number
of functions, each returning a single double variable and call them
one by one, using code like above, and then passing them into an array
in C++, but I would prefer a more elegant way of doing it, because my
return variable could have hundreds, if not thousands, of values..
Can somebody help me please.
Thanks
Pieter Steenekamp.
I don’t have a problem if the Python function returns a single
variable of type double, using the following lines in my C++ code:
myPythonObjectPointer = PyObject_CallObject(pFunc, pArgs);
myCppDoubleVariable = PyFloat_AsDouble(myPyObjectPointer);
(I have obviously done all the required thingies to embed Python in C+
+ as per the Python documentation)
I can achieve what I want by changing the Python function to a number
of functions, each returning a single double variable and call them
one by one, using code like above, and then passing them into an array
in C++, but I would prefer a more elegant way of doing it, because my
return variable could have hundreds, if not thousands, of values..
Can somebody help me please.
Thanks
Pieter Steenekamp.