Calling FORTAN dll functions from Python

Carl Banks pavlovevidence at gmail.com
Wed Dec 8 05:33:46 EST 2010


On Dec 7, 3:11 am, "Alex van der Spek" <zd... at xs4all.nl> wrote:
> Does anyone know how to call functions from FORTRAN dlls in Python? Is it
> even possible? I browsed the documentation for Python 2.6.1 and the Python/C
> API comes close to what I would like to do but it is strictly limited to C.
>
> Unfortunately the passing of arguments in C and FORTRAN is very different,
> not to mention the differences with strings where FORTRAN expects a hidden
> length argument. It could call the FORTRAN dll from C and call the C
> functions from Python but is that my only option?

I'd recommend f2py, which is part of the numpy package.


Carl Banks



More information about the Python-list mailing list