colorama是python第三方库中一个可以改变输出流颜色的玩意儿,
安装可以通过:
pip install colorama
简单介绍
from colorama import Fore, Back, Stylefor color in ['GREEN', 'RED', 'BLUE', 'YELLOW', 'WHITE']:print getattr(Fore, color), "It's color will be", colorprint getattr(Back, color), "It's color will be", colorprint Style.RESET_ALL
查看内部的详情
这个是官方的介绍:
详情见官方文档:colorama