因为python的输出有缓冲:
1. print命令加个参数,flush=True
print(x, flush=True)
2. nohup.log不能够马上看到输出,给 python 加个-u参数,使得python不启用缓冲:
nohup python -u test.py > nohup.log2>&1&
因为python的输出有缓冲:
1. print命令加个参数,flush=True
print(x, flush=True)
2. nohup.log不能够马上看到输出,给 python 加个-u参数,使得python不启用缓冲:
nohup python -u test.py > nohup.log2>&1&