read Zipfile

Chris Rebert clp2 at rebertia.com
Tue Nov 3 01:02:34 CET 2009


On Mon, Nov 2, 2009 at 4:39 PM, sityee kong <skong1 at gmail.com> wrote:
<snip>
> 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,
> file=archive.open("CHAVI_MACS_SC_A__AUG_25_08_FinalReport_090812.csv","r")
> But it turned out error,
>
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> AttributeError: ZipFile instance has no attribute 'open'

ZipFile.open(name[, mode[, pwd]])
[...]
    New in version 2.6.

Would your Python version happen to be pre-2.6?

Cheers,
Chris
--
http://blog.rebertia.com



More information about the Python-list mailing list