You only need Python's ctypes module to load the compiled Fortran library thanks to Fortran's iso_c_binding module.
Using f2c as suggested seems like a worse alternative, not a solution.
You only need Python's ctypes module to load the compiled Fortran library thanks to Fortran's iso_c_binding module.
Using f2c as suggested seems like a worse alternative, not a solution.
essentially madness.
Modern fortran is quite nice, much nicer than C from a Python programmer's perspective.
Totally agree. I hope everyone making comments on Fortran can spend a few minitues reading what modern Fortran is, e.g., by checking
I think a lot of people don’t realize that modern Fortran actually supports object-oriented programming and Matlab-style array slicing, and comes with built-in support for e.g. matrices and complex numbers. It even has some features inspired by functional languages, like being able to mark functions as pure (side-effect free). Combined with its general speed, this makes it a pretty nice language for numerical code.
Although for most new users, I think Julia might be a better option than Fortran these days.