Created
April 28, 2019 21:16
-
-
Save Nef132/1c3636f3f07a92cf29af107ac4cf21cd to your computer and use it in GitHub Desktop.
Instant backup #python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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