Geoffrey Zhu wrote:
 > Hi,
 >
 > I am about to write a C extension module. C functions in the module will
 > take and return numpy arrays. I found a tutorial online, but I am not
 > sure about the following:

I agree with others that ctypes might be your best path.
The codeGenerator is magic, if you ask me:
http://starship.python.net/crew/theller/ctypes/old/codegen.html

But, if the function is simple, why not weave.inline? What I have 
done is run the function once, hunt down the long-named library, copy 
it to the local directory, then include it explicitly and call its 
function. This eliminates some overhead time for the call. I use it 
to convert packed IEEE data from an ADC data read function, and it's 
faster than the manufacturer's own function version that returns 
scaled integers!

Ray

_______________________________________________
Numpy-discussion mailing list
[email protected]
http://projects.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to