Skip to content

Instantly share code, notes, and snippets.

@sodonnell
Created September 14, 2019 20:05
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 sodonnell/790e5734d2bf1b4ec159a2947e00c539 to your computer and use it in GitHub Desktop.
Save sodonnell/790e5734d2bf1b4ec159a2947e00c539 to your computer and use it in GitHub Desktop.
Basic tarfile processing in Python
#!/usr/bin/env python3
import tarfile
tar = tarfile.open("release.tar.gz", "w:gz")
for name in ["LICENSE", "README.md", "bin","src","examples"]:
tar.add(name)
print(tar.list("release.tar.gz"))
tar.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment