0

I am Running a python script to run download commands using shell script and subprocess

import subprocess

script = download.sh
log = open(logfile.txt,"a")
subprocess.run(script,shell=True,stdout=log)
log.close()

I want to supress the downloading indicatior part which is visible when you run when the download startsText_to_supress

I want to supress that part.

KaV
  • 23
  • 5
  • 3
    Does this answer your question? [How to suppress or capture the output of subprocess.run()?](https://stackoverflow.com/questions/41171791/how-to-suppress-or-capture-the-output-of-subprocess-run) – Tarmo Feb 04 '21 at 08:22

1 Answers1

0

you need to capture the stderr as well:

subprocess.run(script,shell=True,stdout=log,stderr=log)
shauli
  • 402
  • 2
  • 4