Passing arguments when python subprocess.Popen in running -
i have simple application (*.exe) passing command line arguments using python subprocess.popen
shown below:
write_data = popen(["test.exe", arg1, arg2)], cwd = target_path, shell = true, stdin=pipe, stdout=pipe) output = '' line in iter(write_data.stdout.readline, ""): print line, output += line
i have programmed application receive arguments , operations. calling subprocess function multiple times every time want test application different data.
is possible run subprocess once , send arguments running process?
i tried write_data.stdin.write(arg3, arg4)
, doesn't seem work.
i think arguments no tool inter-process communication.
you can interact running program using stdin , stdout tried can write stdin write file , read stdout. there no parameters in stdin.
what happens when write stdin depends on receiver. can call receiver on command line , see happens if pipe stdin.
Comments
Post a Comment