KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am trying to use zipfile module to read a file in an archive. the uncompressed file is ~3GB and the compressed file is 200MB. I don't want them in memory as I process the compressed file line by line. So far I have noticed a memory overuse using the following code: import zipfile f = open(...) z = zipfile.ZipFile(f) for line in zipfile.open(...).readlines() print line I did it in C# using the SharpZipLib: var fStream = File.OpenRead("..."); var unzipper = new ICSharpCode.SharpZipLib.Zip.ZipFile(fStream); var dataStream = unzipper.GetInputStream(0); dataStream is uncompressed. I can't seem to find a way to do it in Python. Help will be appreciated.
Tags (comma-separated)
Save Edits
Cancel