【发布时间】:2020-04-12 15:11:12
【问题描述】:
您好,我正在使用 Python,我想在使用 figlet_format 时用颜色打印出程序的名称,所以我在 vscode 中可以正常工作,但是当我尝试在 cmd 中运行文件时,它会打印:
[34m _ _ _ _
| | | | ___| | | ___
| |_| |/ _ \ | |/ _ \
| _ | __/ | | (_) |
|_| |_|\___|_|_|\___/
[0m
insted 打印它在 vscode 中打印的内容:
所以我想知道是否有办法在使用 pyfiglet 时在 cmd 中打印颜色,这是我的代码:
from termcolor import colored
from pyfiglet import figlet_format
print((colored(figlet_format("Hello"), color="blue")))
【问题讨论】:
标签: python colors termcolor figlet