ansi-colors

output of [31m text instead of color

output of [31m text instead of color Question: I am trying to print coloured text with colorama but when I compile an exe and run following… from colorama import Fore, Back, Style print(Fore.RED + ‘text’) print(Back.GREEN + ‘and with a green background’) print(Style.DIM + ‘and in dim text’) print(Style.RESET_ALL) print(‘back to normal now’) I get …

Total answers: 2

Is it possible to print from Python using non-ANSI colors?

Is it possible to print from Python using non-ANSI colors? Question: I’m trying to print log/print text to the terminal with custom colors using Python. I looked around, but couldn’t find anything other than ANSI colors. Do I have to use ANSI colors, or am I able to log/print text with custom colors (for example, …

Total answers: 2

Python’s `str.format()`, fill characters, and ANSI colors

Python’s `str.format()`, fill characters, and ANSI colors Question: In Python 2, I’m using str.format() to align a bunch of columns of text I’m printing to a terminal. Basically, it’s a table, but I’m not printing any borders or anything—it’s simply rows of text, aligned into columns. With no color-fiddling, everything prints as expected. If I …

Total answers: 3

Is there a Term::ANSIScreen equivalent for Python?

Is there a Term::ANSIScreen equivalent for Python? Question: Perl has the excellent module Term::ANSIScreen for doing all sorts of fancy cursor movement and terminal color control. I’d like to reimplement a program that’s currently in Perl in Python instead, but the terminal ANSI colors are key to its function. Is anyone aware of an equivalent? …

Total answers: 4