I need to wrap a C function of interface
double foo(double)
to python, so that in python console
>>foo_py(2.9)
should give me the double value of foo(2.9). Eventually, I use the exported foo_py in scipy.
I have been looking for the simplest way to wrap such a C function.There are certainly many related posts on stackoverflow, but they are dated a couple of years ago and at this moment I am looking for an updated answer for my specific demand. Thanks.
[EDIT] For information, I tried with C extension using PyObj etc. The documentation on this seems lacking. I also tried with Boost.Python that wraps C++ functions to Python. Here I need to wrap C functions (in order to avoid naming demangling issues, etc).