z.close()

def main():
    if len(sys.argv) < 3:
        print('Usage: %s zipname dirname' % sys.argv[0])
exit(1)
zipname = sys.argv[1]
dirname = sys.argv[2]
zipdir(zipname, dirname)
if __name__ == '__main__':
    main()
How to print the percentage of zipping a file python