Skip to content

Instantly share code, notes, and snippets.

@elbuo8
Created November 5, 2013 23:54
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 elbuo8/7328497 to your computer and use it in GitHub Desktop.
Save elbuo8/7328497 to your computer and use it in GitHub Desktop.
tarname = os.getcwd() + '/' + data['name'] + '.tgz'
tar = tarfile.open(tarname, 'w:gz')
for filename in os.listdir(os.getcwd()):
tar.add(filename)
tar.close()
print tarname
files = {'file': open(tarfile, 'rb')}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment