Python command output redirection have caching problems

The Python command output redirected to a log file, and found that the output is not written to the log file

The reason is that Python did a cache, the cache should remove the need to add parameters -u

such as

  nohup python -u test.py > test.log 2>&1 &

 

      

Guess you like

Origin www.cnblogs.com/moonlight-lin/p/12239467.html