linux nohup python 后台运行无输出问题


参考:https://blog.csdn.net/zj360202/article/details/78894512

nohup python test.py &

nohup python test.py 2>&1 &

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

上面三种方式无论在nohup.out 或test.out都看不到数据结果,这是因为python执行有缓存输出。

 

解决:使用-u参数

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

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM