AnnotationLib.py 文件源码

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

项目:cancer 作者: yancz1989 项目源码 文件源码
def saveIDL(filename, annotations):
    [name, ext] = os.path.splitext(filename)

    if(ext == ".idl"):
        file = open(filename,'w')

    if(ext == ".gz"):
        file = gzip.GzipFile(filename, 'w')

    if(ext == ".bz2"):
        file = bz2.BZ2File(filename, 'w')

    i=0
    for annotation in annotations:
        annotation.writeIDL(file)
        if (i+1<len(annotations)):
            file.write(";\n")
        else:
            file.write(".\n")
        i+=1

    file.close()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号