为什么nohup不能在os.system中使用python脚本?

2024-10-03 06:22:25 发布

您现在位置:Python中文网/ 问答频道 /正文

我尝试在集群上的python中使用nohup,但失败了。我的代码如下:

import os

path = "/ldfssz1/SP_MSI/USER/"
os.system("nohup sh "+ path + "myjobs.sh &")

群集仅返回以下内容:

nohup: ignoring input and appending output to `nohup.out'

没有pid返回,作业命令不返回任何内容。有人能告诉我这里发生了什么吗?多谢各位


Tags: path代码importossh集群systemsp