nohup python test.py > nohup.out 2>&1 &

发现nohup.out中显示不出来python程序中print的东西。

这是因为python的输出有缓冲,导致nohup.out并不能够马上看到输出。

python 有个-u参数,使得python不启用缓冲。

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

相关文章:

  • 2021-12-25
  • 2021-06-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-02
  • 2021-06-18
  • 2021-10-21
猜你喜欢
  • 2021-08-15
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案