Hi,
We need to zip files having '2009' in their names from a particular directory. How can we do the same.
Code:
file = zipfile.ZipFile("test.zip", "w")
os.chdir(rawFileLocation)
dirList = os.listdir(rawFileLocation)
for fnames in dirList:
file.write(fnames)
file.close()
It is zipping all the files. Please tell me the logic for adding files which fulfill certain criteria only.
Regards,