zipi = zipfile.ZipInfo()
zipi.filename = 'folder/a'
zipi.date_time = time.localtime(os.path.getmtime('a'))[:6]
zipi.compress_type = zipfile.ZIP_DEFLATED
filedata = open('a', 'rb').read()
zipfile1.writestr(zipi, filedata)
Adding folders to a zip file using python