Pyfiglet/Python – Print Pyfiglet ASCII in one line

Question:

This is my code to print "x t e k k y" 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:
enter image description here

Asked By: xtekky

||

Answers:

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!

Answered By: Austin Rhoads
Categories: questions Tags: , , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.