文件压缩

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)

 

 

相关文章:

  • 2022-02-22
  • 2022-12-23
  • 2021-12-15
  • 2021-10-05
  • 2022-01-05
  • 2021-11-21
  • 2021-06-04
猜你喜欢
  • 2022-12-23
  • 2022-01-16
  • 2021-12-16
  • 2021-12-16
  • 2021-08-18
  • 2022-02-10
  • 2021-10-14
相关资源
相似解决方案