1

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

xtekky
  • 572
  • 1
  • 4
  • 13
  • My first guess is that either `pyfiglet` or `termcolor` have some terminal length as default. Does it still split to two lines if you skip the `colored` function and just do `print(art)`? – SNygard Feb 22 '22 at 16:05
  • 2
    @SNygard related [Can the maximum line width in the terminal be increased in PyCharm?](https://stackoverflow.com/a/67645105) – bad_coder Feb 22 '22 at 16:12

1 Answers1

0

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!