python create zip for sub directory code example Example: zip a directory in python shutil.make_archive(output_filename, 'zip', dir_name)