nohup:尾随“&”阻止写入输出文件?

nohup: trailing "&" prevents writing to output file?

版本 1 无法写入我的 output.txt 文件:

nohup python test.py &> output.txt &

但是版本 2 有效:

nohup python test.py &> output.txt

我需要结尾的 & 因为我想在命令行上执行其他任务!

已解决:... python -u ... 就是答案。似乎这个附加选项阻止了 Python 输出缓冲。