Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ python
- Python 2.7.2 (default, Oct 11 2012, 20:14:37)
- [GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
- Type "help", "copyright", "credits" or "license" for more information.
- >>> import subprocess
- >>> subprocess.call(['zip', 'example.zip', 'example/*'])
- zip warning: name not matched: example/*
- zip error: Nothing to do! (example.zip)
- 12
- >>> quit()
- $ zip example.zip example/*
- adding: example/file.gz (deflated 0%)
- import glob
- import subprocess
- subprocess.call(['zip', 'example.zip'] + glob.glob('example/*'))
- directory = 'example'
- subprocess.call(['zip', '-r', 'example.zip', directory])
Add Comment
Please, Sign In to add comment