import zipfile # 解压到当前目录 with zipfile.ZipFile(archive.zip, r) as zip_ref: zip_ref.extractall() # 解压到指定目录 with zipfile.ZipFile(archive.zip, r) as zip_ref: zip_ref.extractall(/path/to/extract)