I want to run an exe file from python with input and saving the output without printing it, does someone know how can I do it?
1 Answer
Yes, you can. https://docs.python.org/2/library/subprocess.html#module-subprocess
import subprocess
with open('mylog.txt', 'a') as log, open('myerror.txt', 'a') as error_log:
process = subprocess.call(['ls', '-l'], stderr=error_log, stdout=log)