wrapping C functions in python
j.spies at hccnet.nl
Thu Apr 10 11:54:52 CEST 2008
Paul Anton Letnes wrote:
> Hi, and thanks.
> However, being a newbie, I now have to ask: What is SWIG? I have heard
> the name before, but haven't understood what it is, why I need it, or
> similar. Could you please supply some hints?
>>> I am a "scientific" user of Python, and hence have to write some
>>> critical algorithms. Right now, I am learning Python, so this is a
>>> I would like to wrap some heavy C functions inside Python,
>>> specifically a
>>> wavelet transform. I am beginning to become aquainted with the functions
>>> PyArg_ParseTuple() and Py_BuildValue(). However, I am unable to
>>> figure out
>>> how to pass Python list -> C function or C array -> return value in
>>> I manage to build and run the C function, print to screen, pass
>>> string as
>>> argument, return an int, etc. The thing which is missing is the magic
>>> Thanks in advance! I fart in your general direction.
Maybe you should have a look at Cython:
More information about the Python-list