【问题标题】:Pyfiglet/Python - Print Pyfiglet ASCII in one linePyfiglet/Python - 在一行中打印 Pyfiglet ASCII
【发布时间】: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)

输出:

【问题讨论】:

标签: python fonts pycharm output ascii


【解决方案1】:

按这样的格式设置宽度属性

art = figlet_format("x t e k k y", font='alligator', width=110)

调整宽度,直到全部打印在一行上。宽度越宽,您打印的“页面”就越宽。 编码愉快!

【讨论】:

    猜你喜欢
    • 2022-08-19
    • 1970-01-01
    • 1970-01-01
    • 2020-09-03
    • 2022-09-29
    • 1970-01-01
    • 2019-05-27
    • 2015-12-01
    • 1970-01-01
    相关资源
    最近更新 更多