gabc.py 文件源码

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

项目:panflute 作者: sergiocorreia 项目源码 文件源码
def png(contents, latex_command):
    """Creates a png if needed."""
    outfile = sha(contents + latex_command)
    src = os.path.join(IMAGEDIR, outfile + '.png')
    if not os.path.isfile(src):
        try:
            os.mkdir(IMAGEDIR)
            stderr.write('Created directory ' + IMAGEDIR + '\n')
        except OSError:
            pass
        latex2png(latex_command + "{" + contents + "}", outfile)
        stderr.write('Created image ' + src + '\n')
    return src
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号