Sorry, can not figure it out, if you don't gen an answer on this list maybe you should address it on swig list. Personally I use cython for this purpose. Nadav -----Original Message----- From: numpy-discussion-bounces@scipy.org on behalf of Matt Fearon Sent: Mon 24-May-10 15:43 To: Discussion of Numerical Python Subject: Re: [Numpy-discussion] calling C function from Python via f2py Nadav, Thank you. I believe it is working now, as the pos(2) error is gone. However, though the error is gone, my return variable from the C function is not being updated as if the C code is not executing? Syntax to the call the C function from Python is the following: FFMCcalc.FFMCcalc(T,H,W,ro,Fo) Should this execute the C code? thanks, Matt On Sun, May 23, 2010 at 1:44 AM, Nadav Horesh <nadavh@visionsense.com> wrote:

in test.py change to

print FFMCcalc.FFMCcalc(T,H,W,ro,Fo)

As implied from the line

print FFMCcalc.FFMCcalc.__doc__

Nadav

-----Original Message----- From: numpy-discussion-bounces@scipy.org on behalf of Matt Fearon Sent: Fri 21-May-10 21:55 To: numpy-discussion@scipy.org Subject: [Numpy-discussion] calling C function from Python via f2py

Hello,

I am trying to use f2py to generate a wrapped C function that I can call from Python (passing arguments to and from). I have this almost working, but I receive trouble with "exp and pow" related to C and some "pos (2) error" with one of my passed variables. My f2py syntax is:

f2py -c -lm FFMCcalc.pyf FFMCcalc.c

Also, my 3 scripts are short and attached.

1. FFMCcalc.c, C function 2. FFMCcalc.pyf, wrapper file 3. test.py, short python code that calls C function

Any advice would greatly appreciated to get this working. thanks, Matt

_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion