Thanks for the fast responses!
> data. Storing bare pointers in the C side and not holding a
> reference to the object providing the data in the C side is really
> error prone.
It's true, I don't do it because I have to process a large number of arrays,
and each has thousands of elements; so
Hi, I read a file with array data (one per line), and send the arrays to a
module in C. In the C module, I need to store pointers to the arrays, so I
don't have to make a copy for each array it receives from python.
I found that if I reuse the same variable name to create the array, the
pointe
Thanks everyone for all the comments! It helped to understand better the
advantages/disadvantages of the various options to interact with C.
Jose.
--- On Sat 05/17, Bill Spotz < [EMAIL PROTECTED] > wrote:
Just to make sure the original question gets answered, yes, numpy.i
avoids copies as
Hi, I'd like to access a C function from python, and the function takes
input/output arrays. I'd probably use SWIG to do the interface to the C code. I
found 2 options:
-NumPtr module, to access Numeric arrays as pointers
http://www.penzilla.net/tutorials/python/numptr/
- numpy.i, a SWIG interfa