我试图执行此命令,但失败:
cmdp = ("ps --ppid 1 -f | grep interactive > test.out")
sp = subprocess.Popen(cmdp, shell = True, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
name, err = sp.communicate()
rc = sp.wait()
rc返回为1,并且test.out
未创建
如果我在终端中运行ps --ppid 1 -f | grep interactive > test.out
,它工作得很好,test.out
就会被创建。在
目前没有回答
相关问题 更多 >
编程相关推荐