with open(dst_file) as f:
lines = f.readlines()
for line in lines:
f_text = line.strip()
normal = re.sub(r'\s+', ' ', f_text)
print normal
start = normal.find('ent')
f_name = normal[start + 4:]
try:
name = re.match('^confi.xml', f_name)
name.group()
break
print '找到匹配的文件:', f_name
except AttributeError:
continue
old_md5 = normal[:normal.find('/videodata')].strip()
print '需要替换的那行', normal, '之前的MD5值', old_md5
tmp_replace = normal.replace(old_md5, f_md5_value)
print '这个normal有问题',normal
代码格式乱了,问题描述也不清楚