我正在编写一个python脚本,它使用Windows命令行向设备发送命令,然后读取输出迭代其内容:
proc = subprocess.Popen("adb logcat | findstr Test", stdout=subprocess.PIPE)
for line in proc.stdout:
if "stopped" in line:
print line
print "Test Service finished \n"
break
else:
print line
不幸的是,我得到了以下信息:
^{pr2}$如果没有“| findstr Gps”,它也可以工作,但是发送到管道的输出量太大,最终会导致内存事件。在
你知道我做错了什么吗?在
提前谢谢!在
我认为这可能有用(不确定
stderr=subprocess.PIPE
是否真的有必要,尽管它不应该伤害):相关问题 更多 >
编程相关推荐