returning values from FORTRAN with f2py

Chris Fonnesbeck spam at
Sat Sep 7 21:22:16 CEST 2002

I am wondering how to persuade some fortran code that I have compiled
with f2py to return its calculated values to me in python.  I have
some code that does gaussian elimination (mostly from Numerical
Reciopes), and is supposed to return an inverted matrix so that I can
solve a system of linear equations.  However, when run in python, the
function runs without error but returns no values:

>>> a = [[2,1,3],[1,-1,1],[3,6,-1]]
>>> b = [7,2,10]
>>> import gauss
>>> gauss.gauss(a,3,b,1)

Is there something that I have to change in my fortran code to make
this work?

Many thanks,

More information about the Python-list mailing list