You can use the subprocess.check_call module to run the command, you do not need to echo the command to run:
from subprocess import check_call check_call(["./driver.exe", "bondville.dat"])
This is equivalent to running ./driver.exe bondville.dat from bash.
If you want to get the result, you will use check_outout :
from subprocess import check_output out = check_output(["./driver.exe", "bondville.dat"])
In your own code, you basically repeat the command line, which does not actually execute the ie echo "./driver.exe bondville.dat" , which outputs ./driver.exe bondville.dat to your shell.
Padraic cunningham
source share