python改变输出字体颜色==>colorama

时间:2023-03-08 20:04:52
python改变输出字体颜色==>colorama

colorama是python第三方库中一个可以改变输出流颜色的玩意儿, 安装可以通过:

pip install colorama

简单介绍

from colorama import Fore, Back, Style

for color in ['GREEN', 'RED', 'BLUE', 'YELLOW', 'WHITE']:
    print getattr(Fore, color), "It's color will be", color
    print getattr(Back, color), "It's color will be", color
    print Style.RESET_ALL
python改变输出字体颜色==>colorama

查看内部的详情

python改变输出字体颜色==>colorama

官方文档:colorama