16 Jan
2009
16 Jan
'09
12:41 p.m.
On Fri, Jan 16, 2009 at 8:34 AM, Philipp Heuser <philipp@achtziger.de> wrote:
I am trying to return an array from C to Python. Since it is of variable size,
return Py_BuildValue("[f,f,f]", array[0], array[1], array[2]);
does not help. How do I do that?
Try creating a Python tuple or list in your C function and returning that object instead. You can read about those C API functions here:
http://docs.python.org/c-api/tuple.html http://docs.python.org/c-api/list.html
-- Jon Parise (jon of indelible.org) :: "Scientia potentia est"