去掉test.txt中的H,保存到test1.txt
with open('test.txt', 'r') as fpr:
content = fpr.read()
content = content.replace('H', '')
print(content)
with open('test1.txt', 'w') as fpw:
fpw.write(content)
我只能说一般来说,习惯性的logger = logging.getLogger(), handler一般是函数回调用,日志里的handler就是日志输出到哪里。