linux服务器后台启动python程序

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

如上,使用nohup命令,在linux服务器上以后台进程的形式运行python脚本,并输出日志

python可为python2或者python3

test.py 是为要运行的程序

test.log 是为程序运行中打印输出的log文件

其余参数不用改动

猜你喜欢

转载自blog.csdn.net/lyw5200/article/details/109245733