zlib Error -3
DeepBleu
DeepBleu at DeepBleu.org
Mon Jan 7 21:42:54 EST 2002
I see that I can get the text string content of a text file out of a
compressed zip file, and I can write this string into a new text file using
two methods:
If Bytes = text string
1. File = open(NewFile, "w")
File.write(Bytes)
File.close()
OR
2. fd=os.open(NewFile, O_CREAT | O_WRONLY)
File = os.fdopen(fd)
os.write(fd, Bytes)
File.close()
Can someone offer a hint on the difference between the two methods of
writing the same file?
DeepBleu
"Andrew Kuchling" <akuchlin at mems-exchange.org> wrote in message
news:3dofk5dh18.fsf at ute.mems-exchange.org...
> "DeepBleu" <DeepBleu at DeepBleu.org> writes:
> > >>> zlib.decompress("c:\\test.zip")
>
> You want the zipfile module, not the zlib module which implements just
> the low-level compression algorithm. The above line is trying to
> decompress the actual string data c:\test.zip, which obviously isn't
> going to work.
>
> --amk
More information about the Python-list
mailing list