#!/usr/bin/env python #coding: utf-8 import zipfile zip = zipfile.ZipFile('a.zip', 'w' ,zipfile.ZIP_DEFLATED) zip.write('zip.py') zip.close()