__main__.py 文件源码

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

项目:otRebuilder 作者: Pal3love 项目源码 文件源码
def main(args=None):
    if args is None:
        args = sys.argv[1:]

    # TODO Add help output, --help, etc.

    # TODO Handle library-wide options. Eg.:
    # --unicodedata
    # --verbose / other logging stuff

    # TODO Allow a way to run arbitrary modules? Useful for setting
    # library-wide options and calling another library. Eg.:
    #
    #   $ fonttools --unicodedata=... fontmake ...
    #
    # This allows for a git-like command where thirdparty commands
    # can be added.  Should we just try importing the fonttools
    # module first and try without if it fails?

    mod = 'fontTools.'+sys.argv[1]
    sys.argv[1] = sys.argv[0] + ' ' + sys.argv[1]
    del sys.argv[0]

    import runpy
    runpy.run_module(mod, run_name='__main__')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号