使用termcolor模块

来源:互联网 发布:西南交大信息与网络 编辑:程序博客网 时间:2024/06/06 07:35

问题来源:http://stackoverflow.com/questions/287871/print-in-terminal-with-colors-using-python


win7下此操作无效


使用termcolor模块对输出内容颜色进行处理。

例如:

from termcolor import coloredprint colored('hello', 'red'), colored('world', 'green')


详细参考:

https://pypi.python.org/pypi/termcolor


原创粉丝点击