[Numpy-discussion] Compile extension modules with Visual Studio 2005

Ray Schumacher subscriber100@rjs....
Wed Jul 25 08:38:55 CDT 2007


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



More information about the Numpy-discussion mailing list