I have a c-executable that works as:
./avg filename opt1 opt2 opt3
Eg:
./avg one.dat 1 1 -1
returns something like
127.504 2.244375804433813 1.111195552742103 blks: 500
When I try to call this from a python code, I have tried:
import os
os.system("./avg one.dat 1 1 -1")
as well as
import subprocess
#args = ("./avg","one.dat","1","1","-1")
args = ("./avg one.dat 1 1 -1")
popen = subprocess.Popen(args, stdout=subprocess.PIPE)
popen.wait()
output = popen.stdout.read()
print output
Neither works, and the executable that not enough arguments are passed to the executable. It should get at least 4 options.
Any help will be appreciated, thanks in advance.
cis meaningless. Removing the tag.