senna

python run .exe app with argument

半世苍凉 提交于 2019-12-04 05:10:35
问题 If i write this in command prompt: "senna-win32.exe < input.txt >output.txt" it works perfect but i need to do this from python code, how is this possible? I have tried: import subprocess subprocess.call([pathToExe, "input.txt" , "output.txt"]) import subprocess subprocess.call([pathToExe, '< input.txt > output.txt']) I'm getting error of "invalid argument < input.txt > output.txt". 回答1: Thank you Jack!!! import subprocess myinput = open('in.txt') myoutput = open('out.txt', 'w') p =