Getting realtime output using subprocess

前端 未结 18 2785
执笔经年
执笔经年 2020-11-22 10:12

I am trying to write a wrapper script for a command line program (svnadmin verify) that will display a nice progress indicator for the operation. This requires me to be abl

18条回答
  •  时光取名叫无心
    2020-11-22 10:56

    You can direct the subprocess output to the streams directly. Simplified example:

    subprocess.run(['ls'], stderr=sys.stderr, stdout=sys.stdout)
    

提交回复
热议问题