1, 创建zip文件,arcname表示压缩文件的路径
def write(self, filename, arcname=None, compress_type=None): def createZip(): file_name = 'test3.zip' with zipfile.ZipFile(file_name, 'w', zipfile.ZIP_DEFLATED) as f: f.write('img1.jpg') f.write('img2.jpg') f.write('img3.jpg') f.setpassword(b'hello') def write(self, filena