[ctypes-users] numpy array in callback
Brought to you by:
theller
From: Heinzmann, S. (A. N. GmbH) <Ste...@al...> - 2009-02-12 21:04:23
|
Hi all, I am a ctypes beginner who wants to wrap a C library that calls back to python code. When the C code calls the callback a void* to a buffer is passed that I want to convert into a 2-dimensional numpy array. Element type and array dimensions are known to the python side through different means. I am struggling to fiddle the casts or type manipulation. Any hints? The callback routine's signature is: int callback(void *buffer); Cheers Stefan |