0

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 1

0

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)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.