Skip to content

Instantly share code, notes, and snippets.

@rturowicz
Created March 23, 2013 13:36
Show Gist options
  • Save rturowicz/5227757 to your computer and use it in GitHub Desktop.
Save rturowicz/5227757 to your computer and use it in GitHub Desktop.
import os
import zipfile
zf = zipfile.ZipFile("myzipfile.zip", "w")
for dirname, subdirs, files in os.walk("mydirectory"):
zf.write(dirname)
for filename in files:
zf.write(os.path.join(dirname, filename))
zf.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment