を含むファイルがあります
"1111 1111 1111 // google
1111 1111 1111 // google talk browser
1111 1111 1111 // google talks
1111 1111 1111 // google talk"
「//グーグルトーク」関連の行だけを印刷したい(4行目のみ)
このようにこれが機能しないようにしてみました...
with open('file.txt', 'r') as handle:
for index, line in enumerate(handle, 1):
if line.strip() == 'talk':
print 'Match found on line', index