我想用python中的subprocess.call
命令替换os.system
命令
D = "Some string value received at run time"
P = "Some string value received at run time"
Cmd = D + P + "| sudo /bin/tar -xvpPf - 1>> " + LoggerFile
untarCmd = os.WEXITSTATUS(os.system(Cmd))
现在我想用subprocess.call
命令替换上面的os.system
pCmd = subprocess.Popen(shlex.split(D + P),shell=False,stdout=subprocess.PIPE)
untarCmd = subprocess.call(shlex.split("untarCmd"),shell=False,stdin=pCmd.stdout)
但是接收错误
OSError: [Errno 2] No such file or directory
error writing output file
目前没有回答
相关问题 更多 >
编程相关推荐