473,395 Members | 1,532 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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 1426
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Doug Tolton | last post by:
Is there a simple way to zip and unzip files? I'm looking for something along the lines of: zfile = zipfile(r'c:\somefile.zip') zfile.extract(r'c:\somefiles') I've looked at the...
7
by: Paul Brownjohn | last post by:
Hi Guys I need a dll that just unzips zipped files...does anyone know of a freeware or cheapo shareware one that does this. I know there are quite a lot of rather sophisticated ones out there...
3
by: seash | last post by:
H My application creates two files , i have to zip these two files to a a single file, how to use winzip functionality in c# Is there any builtin functions available with visual c# the two file...
7
by: thewhoracle | last post by:
I have a C# application that essentially builds batch and text files and runs them from the command line, but i need to unzip something from the command line. What i need is either an unzipping...
0
by: stjulian | last post by:
On Windows Server 2003, IIS 6 I am looking for an unzipping component. I have a series of files that are available zipped at a considerable decrease in size. And before ASPINET fails on a script...
2
by: bjm | last post by:
I created a self extracting zip file with about 9000 files in it. I extracted it manually from the command line without a problem. However, when I tried to do the same extraction at the same...
0
by: avik1612 | last post by:
Hi, I have created a program to unzip the file. It is unzipping the zip files when put in directory i.e folder inside folder but when i create a zip file without putting in a folder and try to...
1
by: kss | last post by:
Hey all, I am new to python and I need to unzip a zip file which is password protected. I tried using zipfile class. Aparently, when i try doing a zip.read(filename), it throws an exception stating...
1
by: deepakd | last post by:
Hi I'm using wxZipInputStream for unzipping a zipped ".app" file in MAC OS.After unzipping i am not able to run the app.When i manually copy the unix executable to app packages, I am able to run...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.