wasm-demo/demo/ermis-f/python_m/cur/0467

33 lines
902 B
Plaintext
Raw Permalink Normal View History

From: bend at realeducation.com (Benjamin Derstine)
Date: Mon, 26 Apr 1999 13:09:23 -0600
Subject: Using the compression module
Message-ID: <7g2ddf$dra$1@birch.prod.itd.earthlink.net>
X-UID: 467
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