[ctypes-users] Re: copying/slicing ctypes arrays, (c_ulong *n)()
Brought to you by:
theller
From: Florian S. <flo...@gm...> - 2004-12-16 09:28:52
|
On Thu, 16 Dec 2004 09:55:09 +0100, Florian Schulze <flo...@gm...> wrote: > On Wed, 15 Dec 2004 10:57:45 -0800, Ray Schumacher <rj...@bl...> > wrote: > >> At 06:31 PM 12/15/2004 +0100, Thomas Heller wrote: >>> Should work, but builds a large temporary list. Best would be to avoid >>> temporary objects at all, like this (for memmove, you need the latest >>> ctypes release) (I assume that it is possible to get the address of a >>> numarray buffer in a similar way as is possible for a normal array >>> instance): >> >> I'm not sure it will be able to work... >> The closest thing to .buffer_info() for numarray-addressing seems to be >> info(), but it returns text: > > Try src._data (where src is a numarray.ArrayType, I don't know about > Numeric, but it should be similar), it's a Memory object which should be > able to function as a buffer. > > Regards, > Florian Schulze I posted some experiments on the numeric list, Ray asked the same question there and that forced me to try it out ;) Regards, Florian Schulze |