解压压缩包
zipobj.extract() #解压压缩包的某个文件
import zipfile with zipfile.ZipFile('我的文件夹.zip','r') as zipobj: zipobj.extract('我的文件夹/demo18.py', 'new_dir') #解压压缩包的某个文件到某个文件夹下 print(zipobj.namelist())
zipobj.extractall() 解压压缩包全部文件
import zipfile with zipfile.ZipFile('我的文件夹.zip','r') as zipobj: zipobj.extractall()