文件压缩
zipfile_obj = zipfile.ZipFile(zipfile_objpath, 'a', zipfile.ZIP_DEFLATED) for dirpath, dirnames, filenames in os.walk(customer_file_path): for file in filenames: zipfile_obj.write(file, zipfilepath) zipfile_obj.close
文件解压缩
f = zipfile.ZipFile(zipfilepath, 'r') for file_obj in f.namelist(): unzipfile = f.extract(file_obj, unzipfilepath)
、