How do I extract all the contents of a compressed file into the current directory? P.S .: The file has folders and files.
import libarchive
def unpack(file):
#?
How do I extract all the contents of a compressed file into the current directory? P.S .: The file has folders and files.
import libarchive
def unpack(file):
#?
Try using PyLZMA:
import pylzma
i = open(compressed_file, 'rb')
o = open(decompressed_file, 'wb')
s = pylzma.decompressobj()
while True:
tmp = i.read(1)
if not tmp: break
o.write(s.decompress(tmp))
o.close()
i.close()