Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

« Newer Snippets
Older Snippets »
Showing 1-2 of 2 total  RSS 

unix, pack folder and contents with tar gz

tar -zcvf packagename.tar.gz folder/

Using gzip module

Modified from this funny thread in c.l.p
http://groups.google.co.uk/group/comp.lang.python/msg/e53361331c23fd76

import gzip

zfile = gzip.GzipFile('somefile.gz')
content = zfile.read()
zfile.close()
« Newer Snippets
Older Snippets »
Showing 1-2 of 2 total  RSS