|
有人会报怨,Fortran的库太少了
没关系,借助iso_c_binding,可以拥抱粗大腿Python
Forpy: A library for Fortran-Python interoperability
网址:https://github.com/ylikx/forpy
Python造的轮子:list, dict, tuple, numpy可以统统拿来直接用
以下是一个例子:
[Fortran] 纯文本查看 复制代码 08 | ierror = forpy_initialize ( ) |
09 | ierror = list_create ( my_list ) |
11 | ierror = my_list % append ( 19 ) |
12 | ierror = my_list % append ( "Hello world!" ) |
13 | ierror = my_list % append ( 3.14d0 ) |
14 | ierror = print_py ( my_list ) |
|
|