摘要: 1.zipfile模块 import zipfile #导入模块 1.压缩文件 (1)创建压缩包 参数1压缩包名字,参数2以w模式创建,参数3压缩固定写法 zf = zipfile.ZipFile("ceshi0512,zip","w",zipfile.ZIP_DEFLATED) (2)把文件写入压 阅读全文
posted @ 2020-05-22 01:27 我在路上回头看 阅读(183) 评论(0) 推荐(0) 编辑
摘要: import os pathvar =r"E:\python30\day17\ceshi100" lst = os.listdir(pathvar) print(lst) ''' 1.txt 2.txt ceshi200 ''' #(1) 计算文件的大小 size = 0 for i in lst: 阅读全文
posted @ 2020-05-22 00:43 我在路上回头看 阅读(361) 评论(0) 推荐(0) 编辑