469,280 Members | 1,811 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,280 developers. It's quick & easy.

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 gr************@novasyshealth.com
Little Rock, Arkansas

"We are the music makers, and we are the dreamers of dreams." W.W.
Jul 18 '05 #1
1 1334
Use something like:

import zipfile
zfile=zipfile.ZipFile(zipfilename,'r')
contents=zfile.read(filenametoread)

Stripped out of a working program, but not tested.

-Larry Bates
Greg Lindstrom wrote:
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

Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Doug Tolton | last post: by
7 posts views Thread by Paul Brownjohn | last post: by
7 posts views Thread by thewhoracle | last post: by
reply views Thread by stjulian | last post: by
2 posts views Thread by bjm | last post: by
1 post views Thread by kss | last post: by
1 post views Thread by deepakd | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.