Answers for "compress tarfile python"

0

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))
Posted by: Guest on October-13-2021

Python Answers by Framework

Browse Popular Code Answers by Language