I am using an outside program (.exe) written in Fortran in a Python script inside a loop by using
os.system("program.exe")
However, each time Python execute the outside program "program.exe", a black window pops up because of the Fortran program running. And I loop several times, so it can get annoying and impossible to work because of the black windows appearing and disappearing each time "program.exe" is executed.
So I wonder : Is it possible to execute "program.exe" in the background such that I don't see anymore the black windows poping up and I may use my computer for other tasks?
Thank you
EDIT : What have worked with me is
os.chdir("C:/Python_script") # change to the directory containing the program to execute in background
startupinfo = subprocess.STARTUPINFO()
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
subprocess.Popen(["program.exe"], startupinfo=startupinfo).wait()