Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python gzip a file

import gzip
import shutil
with open('/home/joe/file.txt', 'rb') as f_in:
    with gzip.open('/home/joe/file.txt.gz', 'wb') as f_out:
        shutil.copyfileobj(f_in, f_out)
Source by docs.python.org #
 
PREVIOUS NEXT
Tagged: #python #gzip #file
ADD COMMENT
Topic
Name
2+7 =