c-x-a

压缩

import shutil

zipOutputName = "1234"  # 输出1234.zip
fileType = "zip"  # 文件类型zip
path = "."
fileName = "1234.txt" #源文件

shutil.make_archive(zipOutputName, fileType, path, fileName)

解压

import zipfile

zipfilePath = ("./1234.zip")
zip = zipfile.ZipFile(zipfilePath)
zip.extractall(".")
zip.close()

分类:

技术点:

相关文章:

  • 2021-09-27
  • 2022-01-13
  • 2021-06-20
  • 2021-11-27
  • 2021-11-17
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-26
  • 2021-11-30
  • 2022-12-23
  • 2022-02-02
  • 2022-12-23
  • 2022-12-23
  • 2022-02-12
相关资源
相似解决方案