Calling Fortran from Python

Lenard Lindstrom len-l at telus.net
Thu Apr 5 19:12:37 CEST 2007


Mangabasi wrote:
> A little bit of googling solved the problem. instead of
> 
>>>> sample = cdll.sample_dll.SAMPLE
> 
> I used
> 
> 
>>>> sample = windll.sample_dll.SAMPLE
> 
> and now it seems to be working without error messages.
> 
> Thanks a lot.
> 
> 

I remember someone on the ctypes mailing list mentioning that g77 uses 
the C calling convention for exported functions. Other compilers might 
default to standard calls. At least with ctypes one can tinker with 
calling convention and function arguments to make a call work.

Lenard



More information about the Python-list mailing list