read Zipfile

Gabriel Genellina gagsl-py2 at
Tue Nov 3 02:19:01 CET 2009

En Mon, 02 Nov 2009 20:39:07 -0300, sityee kong <skong1 at>  

> However for the ZIP file, let says the ZIP file contains only one member,
>>>> archive.namelist()
> ['CHAVI_MACS_SC_A__AUG_25_08_FinalReport_090812.csv']
> I would like to open the csv file with folowwing command,
> But it turned out error,
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> AttributeError: ZipFile instance has no attribute 'open'
> Do you know the way to open an file from a ZIP archive, but not reading  
> them
> all into memory. I would manipulate each line using "for line in file:"

open was added to the ZipFile class in Python 2.6; which version are you  
I think you can backport the 2.6 version onto 2.5 with little or no effort.

> Hope my contents do make sense.

Yes, it was clear to me.

Gabriel Genellina

More information about the Python-list mailing list