私が含まれている例のように 'test.txtの' ファイルがあります: --
a
--
b
--
c
と私のPythonコード: x = ['a','b','c']
i=1
with open("test.txt", "r") as fin:
with open("result.log", "w") as fout:
for line in fin:
私はPythonの新機能で、次の問題を解決しようとしています。単語を含むリストを繰り返し、ファイル内で検索し、見つかった場合は単語が見つかった行番号を返します。 files = glob.iglob(os.path.join(in_dir, '*.*'))
List = ['word1', 'word2',...'wordn']
for index, word in enumerate(Li