I am having problems trying to use the gzip module, I do the followig
[color=blue][color=green][color=darkred]
>>>import gzip
>>>file = gzip.GzipFile(" testfile.txt")
>>>file.write () -which params does this accept?, archive name?[/color][/color][/color]
I get this ERROR:
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/lib/python2.2/gzip.py", line 139, in write
self.size = self.size + len(data)
AttributeError: GzipFile instance has no attribute 'size'
But if I include a mode in "gzip.GzipFile( "testfile.t xt", 'wb')" or
something like that I don't get an error
and then I manage to do >>>file.close () but still I can't find any
compressed file?
[color=blue][color=green][color=darkred]
>>>import gzip
>>>file = gzip.GzipFile(" testfile.txt")
>>>file.write () -which params does this accept?, archive name?[/color][/color][/color]
I get this ERROR:
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/lib/python2.2/gzip.py", line 139, in write
self.size = self.size + len(data)
AttributeError: GzipFile instance has no attribute 'size'
But if I include a mode in "gzip.GzipFile( "testfile.t xt", 'wb')" or
something like that I don't get an error
and then I manage to do >>>file.close () but still I can't find any
compressed file?
Comment