问题来源:http://stackoverflow.com/questions/287871/print-in-terminal-with-colors-using-python
win7下此操作无效
使用termcolor模块对输出内容颜色进行处理。
例如:
from termcolor import colored
print colored('hello', 'red'), colored('world', 'green')
详细参考:
https://pypi.python.org/pypi/termcolor
本文介绍如何使用Python的termcolor模块实现在终端输出带颜色的文字。该方法适用于Windows 7及以上版本,通过简单示例展示了不同颜色文本的输出效果。
1083

被折叠的 条评论
为什么被折叠?



