#coding=utf-8
import rarfile
path_rar = "E:\\rar_source\\temp.rar"
path_folder = "E:\\folder_target"
temp = rarfile.RarFile(path_rar) #待解压文件
temp.extractall(path_folder) #解压指定文件路径
报错处理:
rarfile.RarCannotExec: Cannot find working tool
(1)将winrar的目录中的UnRAR.exe,拷贝python脚本目录下(测试成功)
(2)环境变量path中加入unrar.exe所在目录(测试未成功)