摘要: 一、with上下文管理 程序运行完成后,必须要有f.close()来关闭文件 # f = open(r"文件路径", mode="rt", encoding="utf-8") # data = f.read(内容) # f.write(内容) # f.close() 使用with,程序运行完成后会自 阅读全文
posted @ 2020-06-11 18:04 1024bits 阅读(255) 评论(0) 推荐(0)