[Numpy-discussion] Looking to access C array in numpy.

Clarke, Trevor tclarke@ball....
Tue Jan 22 14:02:48 CST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I'm calling some python code from a C++ app via an intermediary library
(i.e. I can't directly create Python C objects like Buffers). I'm
passing a void* (cast to a long) to the python method and I'd like to
use numpy to access that memory as an array. I'll know what the C data
type is and the minimum length of the data. It's a continuous array but
is multiple dimensions (either 2 dimensional or 3 dimensional BIP). I
was able to find a may to create an array accessor over a python buffer
but I'm not sure how to back an array with a void* (as a long) or create
a buffer object for that memory inside python. Could someone point me in
the right direction?

- ------------------------------
Trevor R.H. Clarke
tclarke@ball.com
Ball Aerospace & Technologies Corp
GPG key available on random.sks.keyserver.penguin.de

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)

iD8DBQFHlkvo+xUTKUxH/LkRAuzCAJ4ojQRgMgQj6vbhnSU3pxfiilIRYACePqiR
hZyD05z1CgJuOtzw7pdJ9TQ=
=H+HS
-----END PGP SIGNATURE-----



This message and any enclosures are intended only for the addressee.  Please  
notify the sender by email if you are not the intended recipient.  If you are  
not the intended recipient, you may not use, copy, disclose, or distribute this  
message or its contents or enclosures to any other person and any such actions  
may be unlawful.  Ball reserves the right to monitor and review all messages  
and enclosures sent to or from this email address.


More information about the Numpy-discussion mailing list