python实现rar文件解压

python实现rar文件解压

1.pip3 install rarfile 安装rarfile库

(注意是解压,压缩这个方法不支持
#coding=utf-8
import rarfile
path = "E:\\New\\New.rar"
path2 = "E:\\New"

rf = rarfile.RarFile(path)         #待解压文件
rf.extractall(path2)               #解压指定文件路径

  

猜你喜欢

转载自www.cnblogs.com/tester-go/p/9441044.html
今日推荐