On Tue, Dec 7, 2010 at 11:11 AM, Alex van der Spek <zd...@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?
>
> For reference: I am using Python 2.6.1 FORTRAN powerstation 4.0. It is not
> an option to translate the FORTRAN code to C (using f2c) as the source code
> is the official ASME version of calculating steam tables.
>
>
I've done it before by creating C wrapper function and it was relatively
painless, using C wrappers means that it's much easier to integrate into
other languages as well if you need to do more integration down the line.

Katie
-- 
CoderStack
http://www.coderstack.co.uk
The Software Developer Job Board
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to