That looks better, thank you. However I still have a memory error when I try to run it on three or more files that are over 100 MB?
import zipfile, glob, os from os.path import isfile zipnames=filter(isfile, glob.glob('*.zip')) for zipname in zipnames: zf=zipfile.ZipFile(zipname, 'r') for zfilename in zf.namelist(): newFile=open(zfilename, 'wb') newFile.write(zf.read(zfilename)) newFile.close() zf.close() ________________________________________ From: Moos Heintzen [iwasr...@gmail.com] Sent: Monday, March 09, 2009 9:02 PM To: Harris, Sarah L Cc: tutor@python.org Subject: Re: [Tutor] memory error On Fri, Mar 6, 2009 at 5:03 PM, Harris, Sarah L <sarah.l.har...@jpl.nasa.gov> wrote: > fname=filter(isfile, glob.glob('*.zip')) > for fname in fname: > zipnames=filter(isfile, glob.glob('*.zip')) > for zipname in zipnames: > ... It looks you're using an unnecessary extra loop. Aren't the contents of fname similar to zipnames? I tried it with one loop (for zipname in zipnames:) and it worked. P.S. You're at jpl? That's awesome! I was looking at internships they have few days ago. _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor