Re: [Numpy-discussion] memory address of array data?

2009-08-17 Thread Stéfan van der Walt
2009/8/16 Robert kxrobe...@googlemail.com:
 Is there a function to get the memory address (int) of
 (contigious) ndarray data on Python level - like
 array.array.buffer_info() ?
 I'd need it to pass it to a camera function.

Have a look at the array interface:

x.__array_interface__['data']

Regards
Stéfan
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] memory address of array data?

2009-08-17 Thread Gael Varoquaux
On Sun, Aug 16, 2009 at 11:50:44PM -0700, Stéfan van der Walt wrote:
 2009/8/16 Robert kxrobe...@googlemail.com:
  Is there a function to get the memory address (int) of
  (contigious) ndarray data on Python level - like
  array.array.buffer_info() ?
  I'd need it to pass it to a camera function.

 Have a look at the array interface:

 x.__array_interface__['data']

Also, it might be interesting to have a look at the ctypes support:

http://www.scipy.org/Cookbook/Ctypes

Gaël
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion