[Tutor] zip question
Alberto Troiano
albertito_g at hotmail.com
Tue May 10 21:51:19 CEST 2005
Great!!!!!!!!!!!Keep it up!!!!!!
Now you can help with number 7...............................I hope
jejeje
Hi everyone
I need some pointers to solve number 7. For what I can see on that picture
the only hint is the gray line inside the .png drawing, but what can I do
with it?????????
Just tell me where to start and I will try to get from there
Thanks
Alberto
>From: "D. Hartley" <denise.hartley at gmail.com>
>Reply-To: "D. Hartley" <denise.hartley at gmail.com>
>To: Alberto Troiano <albertito_g at hotmail.com>
>Subject: Re: [Tutor] zip question
>Date: Tue, 10 May 2005 10:46:26 -0700
>
>Don't worry, I got it :) Thanks, though!
>
>On 5/10/05, Alberto Troiano <albertito_g at hotmail.com> wrote:
> > The problem is that you have to get the content before you can get the
> > filename or comment of the files.
> > You have to do something like this
> >
> > import zipfile
> > file=zipfile.ZipFile("yourfile.zip")
> > f=file.getinfo(name_of_the_file_inside_yourfile.zip)
> >
> > And then you can take the comments and filenames you want with
> > f.comment
> > f.filename
> >
> > Copy and paste without parenthesis. The getinfo part, You have to get
>the
> > name of the files inside.
> > I did a program to put the name of the files inside the zip in a list
>and
> > then I looped inisde the list with the commands I'm sending you
> >
> > Regards
> >
> > Alberto
> >
> > >From: jfouhy at paradise.net.nz
> > >To: Python tutor <tutor at python.org>
> > >Subject: Re: [Tutor] zip question
> > >Date: Tue, 10 May 2005 13:19:52 +1200 (NZST)
> > >
> > >Quoting "D. Hartley" <denise.hartley at gmail.com>:
> > >
> > > > Instances have the following attributes:
> > > >
> > > > filename, comment, etc.
> > > >
> > > >
> > > > I've tried about ten things to get "filename" to work:
> > > >
> > > > myzip.filename("99905.txt") (str not callable)
> > >
> > >Check out the error message: "str not callable". You are trying to
>call
> > >something whose type is "str" --- ie: a string. In python, there is no
> > >distinction between callable and noncallable attributes.
> > >
> > >try:
> > > >>> print myzip.filename
> > >It should print the filename that this ZipInfo object refers to.
> > >
> > >Likewise, myzip.comment is a string which is the comment attached to
>the
> > >file in
> > >the zip.
> > >
> > >If you have any background in other languges, it might help you to
>think of
> > >these as "member variables" (or whatever they call them). And a
>ZipInfo
> > >object
> > >appears to be similar to a struct in C/C++.
> > >
> > >I hope this helps.
> > >(and if it doesn't, the fault is probably in the explanation, so keep
> > >asking,
> > >and I (or someone else) will try again :-) )
> > >
> > >--
> > >John.
> > >_______________________________________________
> > >Tutor maillist - Tutor at python.org
> > >http://mail.python.org/mailman/listinfo/tutor
> >
More information about the Tutor
mailing list