I am printing some data to the screen and I want to color code certain values. For example, if the number is above 100
, I want it to be red. I can do this by printing "\033[91m {}\033[00m"
to the line before the number as explained in this post. I will need to go back to the 'default' color after that, however, but how do I know what the user's default color is? I have my background as black and the text shows up as white, but for another user who has white background and black text, setting the text color back to 'white' will break.
Is there a way, in Python
to find the user's current 'default' text color?