anita.py 文件源码

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

项目:anita 作者: gson1703 项目源码 文件源码
def download_file(file, url, optional = False):
    try:
        print "Downloading", url + "...",
        sys.stdout.flush()
        my_urlretrieve(url, file)
        print "OK"
        sys.stdout.flush()
    except IOError, e:
        if optional:
            print "missing but optional, so that's OK"
        else:
            print e
        sys.stdout.flush()
        if os.path.exists(file):
            os.unlink(file)
        raise

# Create a file of the given size, containing NULs, without holes.
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号