I tryed everything I found on internet about print with color on python 3.7 on console, but nothing actualy worked. The last thing that I tried was just put the color codes as I see that many people do that.
a='\033[1;31;42m' + "Wellcome to my quiz!" + '\033[0m'
print(a)
But when I try to do it gives me this at output on console:
[1;31;42mWellcome to my quiz![0m
I tryed this too:
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
print bcolors.GREEN + "Wellcome" + bcolors.ENDC
And Gave me this error: "SyntaxError: Missing parentheses in call to print." But when I put the parentheses like this:
print (bcolors.GREEN + "Wellcome to my quiz" + bcolors.ENDC)
The output is similar to the first attempt that I shown:
[92mWellcome to my quiz![0m
Am I doing this wrong or this just doesn't work for me?
Platform: Windows 10 64bit.
Using Python 3.7.4 32bit from https://www.python.org/
Software: PyCharm or IDLE(Default python editor)(most used: IDLE)
PS: I don't wanted to use IDLE to reproduce the colors, I wanted the python terminal/console when we open normally a python file.
*Edit: I'm using the console that came when I installed Python3.7 with IDLE. I'm a beginner.