[Tutor] Zipfile and File manipulation questions.

Chris Hengge pyro9219 at gmail.com
Sat Oct 14 03:50:18 CEST 2006


First question..

This is the code that I have:
for filename in zfile.namelist():
        outfile = open(filename, 'w')
        outfile.write(zfile.read(filename))
        outfile.close()

Is there a way to say :
for filename in zfile.namelist() contains '.txt, .exe':
        outfile = open(filename, 'w')
        outfile.write(zfile.read(filename))
        outfile.close()

second question is along the same lines..

I'm looking for a way to say:
os.remove('All by .py')

or-

os.remove('*.txt, *.exe')

Thank you all again for your time and effort.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20061013/558c479a/attachment.html 


More information about the Tutor mailing list