Skip to content

Instantly share code, notes, and snippets.

@ampz9
Created November 7, 2016 16:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ampz9/9e1b4f0a3daaa396b70f013648b44ea9 to your computer and use it in GitHub Desktop.
Save ampz9/9e1b4f0a3daaa396b70f013648b44ea9 to your computer and use it in GitHub Desktop.
creating tar
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))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment