Suppress stdout / stderr print from Python functions

前端 未结 9 1854
情歌与酒
情歌与酒 2020-11-29 06:59

I have a Python script that is using some closed-box Python functions (i.e. I can\'t edit these functions) provided by my employer. When I call these functions, they are pri

9条回答
  •  自闭症患者
    2020-11-29 07:48

    If you are running this script on a linux based machine, you should be able to:

    $> ./runscript.py > output.txt
    

提交回复
热议问题