我正在執行大型(8000行)庫數據轉換。我在一個文件中讀取並且想要逐行修改它。在到達文件結尾之前停止讀取文件。 open(my $infh, "<", 'infile.pica')
|| die('Could not open pica file');
open(my $outfh, ">", 'infile.pica.norm')
|| die('Could not o
import os
for root, dirs, files in os.walk('Path'):
for file in files:
if file.endswith('.c'):
with open(os.path.join(root, file)) as f:
for line in f: