extra.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:cortex 作者: rdevon 项目源码 文件源码
def unzip(source, out_path):
    '''Unzip function.

    Arguments:
        source (str): path to zip file
        out_path (str): path to out_file

    '''
    print 'Unzipping %s to %s' % (source, out_path)

    if not zipfile.is_zipfile(source):
        raise ValueError('%s is not a zipfile' % source)

    if not path.isdir(out_path):
        raise ValueError('%s is not a directory' % out_path)

    with zipfile.ZipFile(source) as zf:
        zf.extractall(out_path)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号