A previously closed question at
export an array of floats to python
concludes with sturlamolden saying, "Now return myarray and be happy." and Peter Wuertz saying, "Thank you! Thats the complete solution *g*"
This is all good. But I am stuck on the python side where I want to see the array.
I have a c shared library function like
On the python side I load this library and get this pointer
thing looks like a _FuncPtr object. What I can't find (bad googler I guess) is a simple example of seeing or indexing the array elements in my python script. Can anyone show or ref python code that shows how the array is accessed?
export an array of floats to python
concludes with sturlamolden saying, "Now return myarray and be happy." and Peter Wuertz saying, "Thank you! Thats the complete solution *g*"
This is all good. But I am stuck on the python side where I want to see the array.
I have a c shared library function like
Code:
PyObject *theArray(void)
{
return PyArray_SimpleNewFromData(1, dims, NPY_DOUBLE, void* data);
}
Code:
thing = mylib.theArray print thing