1 f = open("yesterday","r",encoding=‘utf-8‘) 2 f_new = open("yesterday2","w",encoding=‘utf-8‘) 3 4 for line in f: 5 if "杜姗姗" in line: 6 line = line.replace("杜姗姗","小九九") 7 f_new.write(line) 8 f.close() 9 f_new.close()
标签:style view 文件 close bad for alt one lap
1 f = open("yesterday","r",encoding=‘utf-8‘) 2 f_new = open("yesterday2","w",encoding=‘utf-8‘) 3 4 for line in f: 5 if "杜姗姗" in line: 6 line = line.replace("杜姗姗","小九九") 7 f_new.write(line) 8 f.close() 9 f_new.close()
标签:style view 文件 close bad for alt one lap
原文地址:https://www.cnblogs.com/ti5142/p/8610200.html