Answers for "unzip gzipp python"

4

unzip in python

import zipfile
with zipfile.ZipFile(path_to_zip_file, 'r') as zip_ref:
    zip_ref.extractall(directory_to_extract_to)
Posted by: Guest on November-22-2020
5

python gzip file

import gzip
f_in = open('/home/joe/file.txt')
f_out = gzip.open('/home/joe/file.txt.gz', 'wb')
f_out.writelines(f_in)
f_out.close()
f_in.close()
Posted by: Guest on May-14-2020

Python Answers by Framework

Browse Popular Code Answers by Language