TOUVE 发表于 2017-5-7 12:02:50

python使用管道获取其它进程的输出内容

def GetLineListFromFile(sFileName):
sCmd = "grep -i 'iphone os' " + sFileName;
output = subprocess.Popen(,stdout=subprocess.PIPE,shell=True).communicate()
lines = output.split('\n');
return lines;
#print (res)
def GetLineListFromArch(sFileName):
sCmd = "zgrep -i 'iphone os' " + sFileName;
output = subprocess.Popen(,stdout=subprocess.PIPE,shell=True).communicate()
lines = output.split('\n');
return lines;
页: [1]
查看完整版本: python使用管道获取其它进程的输出内容