简体   繁体   中英

Pyfiglet/Python - Print Pyfiglet ASCII in one line

This is my code to print "xtekky" whit a cool ASCII font using pyfiglet, but the output always displays in 2 lines, whith gives a bad aestethic, is there any way to fix that?

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)

output: 在此处输入图像描述

set the width property in the format like so

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

Adjust the width until it prints all on one line. The wider the width the wider the 'page' you are printing on. Happy coding!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM