Hi I have been wondering how I can change the colour of my text in the console. I just started Python. Can anyone help?
I'm not sure how to use termcolor, but I can recommend using ANSI escape codes.
print("\033[31;44mHello World!\033[0m") # prints Hello World! with red texts and a blue background
Termcolor module Colored and cprint examples
Note: In the following, color is a string variable from the colors listed in the link provided
from termcolor import colored, cprint #print colored text with cprint cprint('Hello World', color) #print colored text with colored print(colored('Hello World', color))