特定の文字列/メタデータ、16 進タグなどのために何千ものファイルを検索する必要がありますが、私が行ったこの python コードは、非常に長い時間がかかる 1 つのファイルのみを検索します。
def check():
datafile = file('example.txt')
found = False
for line in datafile:
if blabla in line:
found = True
break
return found
found = check()
if found:
print "true"
else:
print "false"
助言がありますか?ありがとう