Skip to content

Instantly share code, notes, and snippets.

@Nef132
Created April 28, 2019 21:16
Show Gist options
  • Save Nef132/1c3636f3f07a92cf29af107ac4cf21cd to your computer and use it in GitHub Desktop.
Save Nef132/1c3636f3f07a92cf29af107ac4cf21cd to your computer and use it in GitHub Desktop.
Instant backup #python
import zipfile
z = zipfile.ZipFile('my-archive.zip', 'w', zipfile.ZIP_DEFLATED)
startdir = "/Users/owner/Devspace/"
for dirpath, dirnames, filenames in os.walk(startdir):
for filename in filenames:
z.write(os.path.join(dirpath, filename))
z.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment