How to read contents of 7z file using python

后端 未结 5 1138
刺人心
刺人心 2020-11-27 20:40

How can I read and save the contents of 7z. I use Python 2.7.9, I can extract or Archive like this, but I can\'t read contents in python, I only listing the file\'s contents

5条回答
  •  伪装坚强ぢ
    2020-11-27 21:35

    you can Use pyunpack and patool library

    !pip install pyunpack
    
    !pip install patool
    
    from pyunpack import Archive
    Archive('7z file source').extractall('destination')
    

    refer

    https://pypi.org/project/patool/
    https://pypi.org/project/pyunpack/

提交回复
热议问题