cli.py 文件源码

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

项目:therapist 作者: rehandalal 项目源码 文件源码
def output(message, **kwargs):
    def repl(match):  # pragma: no cover
        attr = match.group(0)[2:-1].upper()
        if hasattr(colorama.Fore, attr):
            return getattr(colorama.Fore, attr)
        elif hasattr(colorama.Style, attr):
            return getattr(colorama.Style, attr)
        else:
            return match.group(0)

    message, count = re.subn('#{(.+?)}', repl, message)
    message = colorama.Style.RESET_ALL + message + colorama.Style.RESET_ALL
    print_(message, **kwargs)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号