C API: array of floats/ints from python to C and back

Robert Kern robert.kern at gmail.com
Sat Dec 27 19:37:30 EST 2008


Daniel Fetchinson wrote:

> I agree that array.array is more efficient than a list but the input
> for my function will come from PIL and PIL returns a list. So I have a
> list to begin with which will be passed to the C function.

With recent versions of PIL, numpy can create an array from an Image very 
quickly, possibly without any copying of memory.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco




More information about the Python-list mailing list