I would like to call some functions from a Fortran shared library in Python. I have found some links on the net and read them, and according what I found, I should do
<
For f2py (from NumPy) to work, borrow both the mult.f90 and add.f90 examples from @samplebias. From a shell, compile the Python importable shared libraries:
f2py -c -m mult mult.f90
f2py -c -m add add.f90
Now use them in Python:
>>> import add
>>> import mult
>>> add.addtwo(4, 5)
9
>>> mult.multiply(4, 5)
20