摘要: 2020python练习六——文件处理1 @2020.3.13 #1、编写文件copy工具 src_file=input('源文件路径>>: ').strip() dst_file=input('请输入保存文件路径>>: ').strip() with open(r'{}'.format(src_f 阅读全文
posted @ 2020-03-13 20:51 bigorangecc 阅读(348) 评论(0) 推荐(0) 编辑
摘要: 一、文件处理 错误类型: UnicodeDecodeError: 'gbk' codec can't decode byte 0x8c in position 14: illegal multibyte sequence 1、 t 模式下的 读操作 新建txt文件 313.txt —— hello 阅读全文
posted @ 2020-03-13 19:15 bigorangecc 阅读(897) 评论(0) 推荐(0) 编辑
摘要: 【目录】 1、什么是文件 2、为何要用文件 3、如何使用文件 3.1 基本操作流程 3.1.1 基本流程 3.1.2 with上下文管理 3.1.3 指定字符编码 3.2 模式介绍 3.3 文件的操作模式 3.3.1 控制文件读写内容的模式 3.3.2 控制文件读写操作的模式 3.4 操作文件的其他 阅读全文
posted @ 2020-03-13 18:04 bigorangecc 阅读(375) 评论(0) 推荐(0) 编辑