zip directories in pytho code example Example: zip a directory in python shutil.make_archive(output_filename, 'zip', dir_name)