Unzipping Files

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Greg Lindstrom

    Unzipping Files

    Hello-
    I am trying to read a file from a zip archive. I have read the
    documentation on zipfile and can read the names of the files in the
    archive and the length of each file, but do not see how to get to the
    actual data from any given file. This is probably so simple that it
    hurts, so take it easy on me if you please...I just don't see it and
    have a deadline rushing towards me. How do I read the data from a file
    in a zip archive?

    Thanks!
    --greg

    --
    Greg Lindstrom 501 975.4859 (office)
    Senior Programmer 501 219-4455 (fax)
    NovaSys Health greg.lindstrom@ novasyshealth.c om
    Little Rock, Arkansas

    "We are the music makers, and we are the dreamers of dreams." W.W.


  • Larry Bates

    #2
    Re: Unzipping Files

    Use something like:

    import zipfile
    zfile=zipfile.Z ipFile(zipfilen ame,'r')
    contents=zfile. read(filenameto read)

    Stripped out of a working program, but not tested.

    -Larry Bates


    Greg Lindstrom wrote:[color=blue]
    > Hello-
    > I am trying to read a file from a zip archive. I have read the
    > documentation on zipfile and can read the names of the files in the
    > archive and the length of each file, but do not see how to get to the
    > actual data from any given file. This is probably so simple that it
    > hurts, so take it easy on me if you please...I just don't see it and
    > have a deadline rushing towards me. How do I read the data from a file
    > in a zip archive?
    >
    > Thanks!
    > --greg
    >[/color]

    Comment

    Working...