Python脚本后台执行
在Linux中,可以使用nohup将脚本放置后台运行,如下:
nohup python myscript.py params1 > nohup.out 2>&1 &
- 使用-u参数,使得python不启用缓冲。
nohup python -u myscript.py params1 > nohup.out 2>&1 &
今日事今日毕
在Linux中,可以使用nohup将脚本放置后台运行,如下:
nohup python myscript.py params1 > nohup.out 2>&1 &
nohup python -u myscript.py params1 > nohup.out 2>&1 &