-1
print("this text is blue")

How could I make the text blue? I have:

print('\033[94m' + "this text is blue")

and

print("\033[94mthistextisblue")

However, nothing has worked so far.

gen_Eric
  • 214,658
  • 40
  • 293
  • 332

1 Answers1

0

The best way to do that is to use the colorama module!

https://pypi.org/project/colorama/

https://github.com/tartley/colorama

It's compatible with all OSes. It's easy to use and much much safer than doing all of those special/exit etc characters by hand

John
  • 689
  • 1
  • 7
  • 16
  • Sadly, isn't working. I am using trinket.io - python 3. When I try to run the Colorama module it says: Traceback (most recent call last): File "/tmp/sessions/b5114d4cc01b4ac1/main.py", line 1, in from colorama import Fore, Back, Style ModuleNotFoundError: No module named 'colorama' – Martin Cristovao Jan 14 '21 at 19:01
  • Thats because you have to install it first. I would suggest you learn how installing modules in python works. For example you can install it using command line: `pip install colorama` – John Jan 14 '21 at 20:35