generic.py 文件源码

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

项目:nml-andythenorth 作者: andythenorth 项目源码 文件源码
def print_warning(msg, pos = None):
    """
    Output a warning message to the user.
    """
    if verbosity_level < VERBOSITY_WARNING:
        return
    if pos:
        msg = str(pos) + ": " + msg

    msg = " nmlc warning: " + msg

    if (sys.stderr.isatty()) and (os.name == 'posix'):
        msg = "\033[33m" + msg + "\033[0m"

    hide_progress()
    print(msg, file=sys.stderr)
    show_progress()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号