Dec-01-2020, 07:14 AM
How are you trying to open it? It's a zipfile, but you didn't change the name, so it's got the same name as it had before. You should name the zipfile with a .zip ending.
for fname in glob.glob('C:\\02\\*[0-9].*'): print (fname) basename = os.path.basename(fname) fz = zout+basename print (fz) zipname = os.path.splitext(fz)[0] + ".zip" # Change name to have .zip extension with ZipFile(zipname,'w') as zip: # Use .zip name for zipfile zip.write(fname)