0
有困難的時候瞭解如何讓Python調用系統函數...蟒蛇系統調用
the_file = ('logs/consolidated.log.gz')
webstuff = subprocess.Popen(['/usr/bin/zgrep', '/meatsauce/', the_file ],stdout=subprocess.PIPE) % dpt_search
for line in webstuff.stdout:
print line
試圖讓蟒蛇建立與我的搜索字符串的另一個文件。
謝謝!
我不知道你打算如何寫你的工作... –
:)在Perl中,你會寫系統或qx(「/ usr/bin/zgrep等等filename> output「); – Cmag
你有一個'%'在那裏。這不是'%'*可能*去的地方,更不用說它會去的地方。 –