【发布时间】:2014-04-24 14:41:58
【问题描述】:
我正在尝试搜索变量的输出以查找特定单词,然后让它触发响应,如果为真。
variable = subprocess.call(["some", "command", "here"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
for word in variable:
if word == "myword":
print "something something"
我确定我在这里遗漏了一些重要的东西,但我就是不知道它是什么。
在此先感谢您直言不讳。
【问题讨论】:
标签: python grep subprocess