摘要:
# python 文件读写,使用with避免try...finally的繁琐 # 1、读取全部内容.文件太大可能会把内存爆了, 可用file.read()限制读取大小 with open("test.txt", "r", encoding='utf8', errors='ignore') as file: print("1: ", file.read()) # 2、按行读取,适合读取配置...
阅读全文
posted @ 2018-11-22 11:56
蛋尼
阅读(134)
推荐(0)
编辑