Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #1/usr/bin/env python
- # this is from The Python
- # Standard Library by example
- # ISBN13: 9780321767349
- import gzip
- import os
- outfilename = 'example.txt.gz'
- with gzip.open(outfilename, 'wb') as output:
- output.write('Contents of the esxample file go here. \n')
- print outfilename, 'contains', os.stat(outfilename).st_size, 'bytes'
- os.system('file -b --mime %s' % outfilename)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement