Python & zipfiles
bielen at stafa.nl
Tue Jun 25 05:53:40 EDT 2002
I use a module to work with zipfiles.
This one is only for unpacking files
from the zip. But i only want to know
if i have to much code to do the trick.
I'm barely new to python, that's why i ask.
--- begin script
from zipfile import ZipFile
zipdir = '/as400/Beheer/Databases/'
zipfiles = ZipFile(zipdir + 'dbs.zip').namelist()
ZipFile(zipdir + 'dbs.zip','r')
for file in zipfiles:
source = ZipFile(zipdir + 'dbs.zip').read(file)
ZipFile(zipdir + 'dbs.zip').close()
--- end of script ---
The problem is, that i don't know if i use the
ZipFile-command too much... because the manual
told me i have to close it afterwards, but it's
not clear to me if i have to expecitely open it.
Any help or code cleaning would be really appre-
More information about the Python-list