How to make shell output redirect (>) write while script is still running?

前端 未结 3 1331
南旧
南旧 2021-01-02 07:38

I wrote a short script that never terminates. This script continuously generates output that I have to check on every now and then. I\'m running it on a lab computer through

3条回答
  •  难免孤独
    2021-01-02 08:25

    You need to flush the output sys.stdout.flush() (or smth) if you want to see it immediately. See this

提交回复
热议问题