I am writing a console-based program in Python.
I saw how to change colours in a terminal.
After seeing a SO question, I applied it to my program:
print('\033[91m' + "Empty command not accepted." + '\033[0m'
Which gives the following in cmd.exe:
←[91mEmpty command not accepted.←[0m
But running the same in Windows Terminal which came pre-installed on Windows 11 (also available in Microsoft Store) produced the desired output, i.e., text printed in red colour.
After researching for a while, I saw that using colorama
, the problem could be fixed.
But I quite liked the console GUI of Windows Terminal, so I was wondering if I could somehow pack/bundle it up with my program, so that users who doesn't have Windows Terminal installed on their PCs can use the program.
Is there a way for it?
Sorry, if it's a silly question.
Thanks.