Change Text Color Output in Python - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Change Text Color Output in Python (/thread-16548.html) |
Change Text Color Output in Python - bluethundr - Mar-04-2019 I'm trying to change the output text to green and the background to blue using this code: print("\033[1;32;44m******************************************************") print("\033[1;32;44m* Terminate Instance Operations in AWS Are Complete. *") print("\033[1;32;44m******************************************************")But the output is the the default powershell white and the numeric codes are visible. This is how the output looks: What am I doing wrong?
RE: Change Text Color Output in Python - stranac - Mar-04-2019 Those look like ansi color escapes, which don't work on windows afaik. If you need a cross-platform way to display colored output, you should take a look at colorama. RE: Change Text Color Output in Python - bluethundr - Mar-06-2019 (Mar-04-2019, 07:56 PM)stranac Wrote: Those look like ansi color escapes, which don't work on windows afaik. Thanks! I got colorization of my python scripts text output to work on windows and linux with Colorama! Good stuff! I appreciate the tip! |