debug.py 文件源码

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

项目:OpenMDAO 作者: OpenMDAO 项目源码 文件源码
def _get_color_printer(stream=sys.stdout, colors=True):
    """
    Return a print function tied to a particular stream, along with coloring info.
    """
    try:
        from colorama import init, Fore, Back, Style
        init(autoreset=True)
    except ImportError:
        Fore = Back = Style = _NoColor()

    if not colors:
        Fore = Back = Style = _NoColor()

    def color_print(s, fore='', color='', end=''):
        """
        """
        print(color + s, file=stream, end='')
        print(Style.RESET_ALL, file=stream, end='')
        print(end=end)

    return color_print, Fore, Back, Style
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号