Ok trying to work with zipFile library how do you flatten the file hierarchy
what works
zipFile = zipfile.ZipFile(imgSetup[0]+'/'+zipName, 'w')
for picId, pathname in enumerate(pic_list):
if start <= picId and picId <= end:
zip.write(filedir+'/'+pathname)
zip.close()
what i am trying
zipFile = zipfile.ZipFile(imgSetup[0]+'/'+zipName, 'w')
for picId, pathname in enumerate(pic_list):
if start <= picId and picId <= end:
fileObj = open (filedir+'/'+pathname)
zip.write(fileObj)
zip.close()
Am i on the right track if so how do I make it work