python 控制台颜色控制 termcolor

安装 termcolor

pip install termcolor

  

from termcolor import colored
 
# 主要可以用到三个参数,
# 参数一:输出的文本
# 参数二:字体颜色,red, green, yellow, blue, magenta, cyan, white.
# 参数三:背景颜色,on_red, on_green, on_yellow, on_blue, on_magenta, on_cyan, on_white.
 
print(colored("satori", "green", "on_yellow"))

  

posted @ 2020-12-24 14:33  人不知所  阅读(471)  评论(0)    收藏  举报