記錄用python壓解縮各種類型文件
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 23 10:13:52 2023
@author: 02279074
"""
"""
1.7z 安裝:pip install py7zr
"""
#%% 1.7z
#解壓7z文件
import os
import py7zr
p=r'C:\Users\02279074\OneDrive - Elanco\Documents\Python_Scripts'
f='全國行政區域.7z'
tgt=py7zr.SevenZipFile(os.path.join(p,f)) #7z目標文件
tgt.extractall(path=p) #解壓到指定目錄
tgt.close() #關閉文件
#%%