函数的命名空间 著名的python之禅 Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better than nested. Sparse is better than dense. Readability counts. Special cases aren't…
修改文件(原理)--回顾 #修改文件(原理) with open('name','r',encoding='utf-8') as f,\ open('password','w+',encoding='utf-8') as f1: for line in f: if '开始' in line: line = line.replace('开始','千字文')#替换字符 f1.write(line) f1.seek(0) print(f1.read()) #import后续再详解 import os…