我有一個Fortran程序,並希望在python中執行多個文件。我有2000個輸入文件,但是在我的Fortran代碼中,我一次只能運行一個文件。我應該如何在python中調用Fortran程序?如何在python中執行Fortran程序
我的腳本:
from numpy import f2py
with open("phase1.f") as sourcefile:
sourcecode = sourcefile.read()
f2py.compile(sourcecode, modulename='add')
錯誤:
Could not locate executable C:\Users\Vishnu\Anaconda2\python.exe Executable C:\Users\Anaconda2\python.exe does not exist
看來你的Python安裝很糟...... –