I'm new to Python, trying to print a colored text in the console. My OS is windows 10. Here is the code:
class bcolors:
"""
Colors for console
"""
HEADER = '\033[95m'
YGREEN = '\033[92m'
WARNING = '\033[93m'
ENDC = '\033[0m'
def main():
user_name: str = input(
f'***Hello {bcolors.YGREEN}friend{bcolors.ENDC} Welcome***\nPlease enter your Name:\n')
if __name__ == '__main__':
main()
but when I execute this code either through CMD or PyCharm, I don't get colored text. Here is the output:
What's wrong?