Re: [Numpy-discussion] numpy.ctypeslib.ndpointer and the restype attribute [patch]

2009-03-26 Thread Jens Rantil
Hi again, On Mon, 2009-03-23 at 14:36 +0100, Jens Rantil wrote: > So I have a C-function in a DLL loaded through ctypes. This particular > function returns a pointer to a double. In fact I know that this > pointer points to the first element in an array of, say for > simplicity,

Re: [Numpy-discussion] numpy.ctypeslib.ndpointer and the restype attribute

2009-03-24 Thread Jens Rantil
On Mon, 2009-03-23 at 15:40 +0100, Sturla Molden wrote: > def fromaddress(address, nbytes, dtype=double): > class Dummy(object): pass > d = Dummy() > d.__array_interface__ = { > 'data' : (address, False), > 'typestr' : numpy.uint8.str, > 'descr' : numpy.uint8.

[Numpy-discussion] numpy.ctypeslib.ndpointer and the restype attribute

2009-03-23 Thread Jens Rantil
Hi all, So I have a C-function in a DLL loaded through ctypes. This particular function returns a pointer to a double. In fact I know that this pointer points to the first element in an array of, say for simplicity, 200 elements. How do I convert this pointer to a NumPy array that uses this da