摘要: 1、通用文件copy工具实现 src_file=input('源文件路径>>: ').strip() dst_file=input('源文件路径>>: ').strip() with open(r'{}'.format(src_file),mode='rt',encoding='utf-8') as 阅读全文
posted @ 2020-03-16 22:02 凌醉枫 阅读(193) 评论(0) 推荐(0) 编辑
摘要: Mode模式的集中选择 x模式(控制文件操作的模式)-》了解 # x, 只写模式【不可读;不存在则创建,存在则报错】with open('a.txt',mode='x',encoding='utf-8') as f: pass with open('c.txt',mode='x',encoding= 阅读全文
posted @ 2020-03-16 19:23 凌醉枫 阅读(295) 评论(0) 推荐(0) 编辑