您的位置:首页 > 运维架构 > Linux

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

2017-12-25 16:55 507 查看
nohup python test.py &
nohup python test.py 2>&1 &
nohup python test.py > test.out 2>&1 &
上面三种方式无论在nohup.out 或test.out都看不到数据结果,这是因为python执行有缓存输出

解决

nohup python -u test.py > test.out 2>&1 &
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息