0

How do I save the output AND see the output in the terminal at the same time?

For example:

result = subprocess.run(['ls'], stdout=subprocess.PIPE,  stderr=subprocess.STDOUT)
print(result)

This only saves the output, I can't see the output on terminal.

How can I do both?

Thanks.

  • 1
    The output is stored in `result.stdout`. What exactly are you aiming for here? – Rfroes87 Nov 28 '20 at 21:11
  • Does this answer your question? [How to redirect stdout to both file and console with scripting?](https://stackoverflow.com/questions/14906764/how-to-redirect-stdout-to-both-file-and-console-with-scripting) – CryptoFool Nov 28 '20 at 21:27

0 Answers0