I had a look in many different answers, but none of them solve my problem.
I'm writing a python script to run an external software (written in fortran and compiled) that thakes itself some arguments.
This is the structure of the folder:
a.out (-> the compiled and running software)
zbtest.lst
zbtest.bud
zbtest.nam
In a normal shell session, when running ./a.out
the program starts and ask me in sequence the zbtest.lst
, zbtest.bud
, zbtest.nam
files.
Now, how can I concatenate the command that runs the compiled software and give in sequence the file asked?
Once in the correct directory and after reading many answers, I tried with:
import subprocess
subprocess.Popen('./a.out ; zbtest.lst ; zbtest.bud ; zbtest.nam', shell = True)
but it seems that only the first argument is taken (./a.out
). The prompt of the software runs well, but it keeps asking me the 3 files listed.
I have no idea how to do that..
Thanks!