压缩
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()