So I was working on some random project for fun, and I wanted to colour my text green, to show that they found an Easter egg. I used the ANSI codes suggested by my dear friend Google, and I ran the program. And the colour didn't work. Just to make sure it wasn't a problem in my program, I ran it in the OG Python terminal (in command prompt, using 'C:\Users\Dell> python'
). And it still didn't work.
Trying to print text with colours.
I tried using the ANSI codes straight-up, I tried making a class out of it, I also tried using colorama and termcolor (although it's not showing in the screenshot), with the same results.
Seeing as I've made such a program before that with colours that worked perfectly, and seeing as I've followed of the steps provided by the Internet, what went wrong?
Asked
Active
Viewed 28 times
0

ArNootNoot
- 1
- 3
-
This seems to be a common issue: https://stackoverflow.com/questions/16755142/how-to-make-win32-console-recognize-ansi-vt100-escape-sequences – fsimonjetz Jun 28 '21 at 17:55
-
Also see: [SuperUser: Windows console with ANSI colors handling](https://superuser.com/a/1050078) – Samathingamajig Jun 28 '21 at 18:00