【发布时间】:2018-07-04 20:44:09
【问题描述】:
我可以在 ipython 中将 test1 打印为绿色,将 test2 打印为红色:
print ('\033[92m' + "test1")
print ('\033[91m' + "test2")
但在终端中以白色打印给我以下错误:
[92mtest1
[91mtest2
【问题讨论】:
-
pip install pygments? -
感谢它与 colorama 一起使用
标签: python windows python-3.x terminal