jupyter 解压缩zip文件

解压到当前目录

!unzip example.zip


# 或者指定解压路径
!unzip example.zip -d ./target_folder

方法二:

import zipfile

# 指定要解压的 zip 文件路径
zip_path = 'example.zip'

# 指定解压到的目标文件夹
extract_path = './extracted_folder'

# 解压
with zipfile.ZipFile(zip_path, 'r') as zip_ref:
    zip_ref.extractall(extract_path)
posted @ 2025-12-19 10:57  点影成金  阅读(28)  评论(0)    收藏  举报