如何使用python批量处理rar文件,rarfile

https://pypi.org/project/rarfile/

https://python-unrar.readthedocs.io/en/v0.3/rarfile.html

https://rarfile.readthedocs.io/api.html

 

pip install rarfile

 

 

import rarfile

rf = rarfile.RarFile("myarchive.rar")
for f in rf.infolist():
    print(f.filename, f.file_size)
    if f.filename == "README":
        print(rf.read(f))

  

posted @ 2021-05-15 00:35  profesor  阅读(228)  评论(0编辑  收藏  举报