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 in CMD
import subprocess
import os
source = 'filename.7z'
directory = 'C:\Directory'
pw = '123456'
subprocess.call(r'"C:\Program Files (x86)\7-Zip\7z.exe" x '+source +' -o'+directory+' -p'+pw)
You can use either libarchive or pylzma. If you can upgrade to python3.3+ you can use lzma, which is in the standard library.