Using F2PY

F2PY automates integration of Python and Fortran
Say the F77 code is in the file hw.f
Run F2PY (-m module name, -c for compile+link):
f2py -m hw -c hw.f
Load module into Python and test:
from hw import hw1, hw2
print hw1(1.0, 0)
hw2(1.0, 0)
In Python, hw appears as a module with Python code...
It cannot be simpler!

previousnexttable of contents