Simple script to make .png thumbnails from .zip archive...

K P S ksheka at gmail.com
Tue Jun 20 04:06:33 CEST 2006


Thanks everyone.

One last thing (I hope).

How can I get the name of just the first file in a zipfile?  I see
routines to list all the files in a zip archive, but I don't see any to
list only the first, or only the second, etc.  It doesn't look like
zipfile is storing info in a useful array that I can hash into.  Or is
it?

Actually, I would like to get the name of the first file with a .jpg
extension, if that's not asking too much. :-)

zip=zipfile.ZipFile("text.zip",mode="r")
picture=zip.read(zip.namelist(0))

This doesn't seem to work. :-(




More information about the Python-list mailing list