【发布时间】:2022-05-06 13:50:01
【问题描述】:
这是我使用 pyfiglet 用很酷的 ASCII 字体打印“x t e k k y”的代码,但输出总是显示为 2 行,这给人一种不好的审美,有什么办法可以解决这个问题吗?
from pyfiglet import figlet_format
from termcolor import colored
art = figlet_format("x t e k k y", font='alligator')
c_art = colored(art, 'blue')
print(c_art)
【问题讨论】:
-
我的第一个猜测是
pyfiglet或termcolor默认有一些终端长度。如果您跳过colored函数而只执行print(art),它是否仍会分成两行?
标签: python fonts pycharm output ascii