Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

compress tarfile python

import tarfile
import os.path

def make_tarfile(output_filename, source_dir):
    with tarfile.open(output_filename, "w:gz") as tar:
        tar.add(source_dir, arcname=os.path.basename(source_dir))
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #compress #tarfile #python
ADD COMMENT
Topic
Name
5+2 =