Python之读取文件指定字符串

Python之读取文件指定字符串

打开文件pmcdr,按行读取,取出以changeset:开头的行并保存到文本文件 out.txt 中

import re
f = open('out.txt','w')
with open('pmcdr','rU') as file_object:
    for line in file_object

你可能感兴趣的:(Python,python)