Re: How to use a Python function that returns a double array in C++.

2008-12-03 Thread Hrvoje Niksic
pieter <[EMAIL PROTECTED]> writes: > I want to use a Python function that returns a double array in C++. Return an array.array('d') object, and use the buffer protocol (for example PyObject_AsReadBuffer()) to get the address of the underlying array of native doubles. -- http://mail.python.org/mai

How to use a Python function that returns a double array in C++.

2008-12-03 Thread 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 = PyF