I call an exe tool from Python:
args = '-i' + inputFile
cl = ['info.exe', args]
subprocess.call(cl)
How would I redirect output from the info.exe to out.txt?
You can redirect output to file object by specifying it as stdout argument to subprocess.call. Put it in a context manager to write to file safely.
with open('out.txt', 'w') as f:
subprocess.call(cl, stdout=f)
Or open the file in wb mode and use subprocess.check_output:
with open('out.txt', 'wb') as f:
f.write(subprocess.check_output(cl))