Hello,
I'm looking for a simple example of how to use the compression module, gzip.
All I want to do is a make a compressed copy of a file. From the gzip
documentation I see how to open a file for compression but I'm not sure what
to do with it after that. From the gzip documentation:
open (fileobj[, filename[, mode[, compresslevel]]])
Returns a new GzipFile object on top of fileobj, which can be a regular
file, a StringIO object, or any object which simulates a file.
Okay, so I opened this file object :
f=open('/Audit.dbf','r')
test=gzip.GzipFile('Auditc','r','9',f)
So now how do I produce a compressed version of it?
Thanks,
Ben
I'm looking for a simple example of how to use the compression module, gzip.
All I want to do is a make a compressed copy of a file. From the gzip
documentation I see how to open a file for compression but I'm not sure what
to do with it after that. From the gzip documentation:
open (fileobj[, filename[, mode[, compresslevel]]])
Returns a new GzipFile object on top of fileobj, which can be a regular
file, a StringIO object, or any object which simulates a file.
Okay, so I opened this file object :
f=open('/Audit.dbf','r')
test=gzip.GzipFile('Auditc','r','9',f)
So now how do I produce a compressed version of it?
Thanks,
Ben