-2

So I have been trying to change the colour of the output in the shell, but it just ends up returning boxes. I am using python 3.7.4.

The code and the output

  • 1
    Not all terminals support coloured output. Apparently, IDLE is one of those. Try running this in the command line. – ForceBru Feb 08 '20 at 14:30
  • About the boxes see the comment above, about other ways see [this](https://stackoverflow.com/questions/5947742/how-to-change-the-output-color-of-echo-in-linux) – Tomerikoo Feb 08 '20 at 14:35

1 Answers1

0

Printing colored output depends on what platform you are on. The most common way to do this is by printing ANSI escape sequences. But that is not supported on all terminals, thus why you see those boxes / weird characters

You can use cmder which works on windows and supports ANSI

enter image description here

Kasem Alsharaa
  • 807
  • 1
  • 6
  • 15