Python outputs a color string and python outputs a string.
Output A color string to display the highlighted part. Tested, it is feasible in pycharm and not feasible in windows command line. Unknown cause.
Method:
Format: "\ 033 [display mode; foreground color; background color m: a color-changing string \ 033 [display mode m" Example: "\ 033 [1; 31; 47 m color changing string \ 033 [0 m "<1-highlight 31 foreground color red 47 background color black -- Color Changing string -- 0-cancel color setting> description: foreground color background color --------------------------------------- 30 40 black 31 41 red 32 42 green 33 43 colors 34 44 blue 35 45 purple red 36 46 Blue 37 47 white display meaning ------------------------- 0 terminal default settings cancel color settings) 1 Highlight 4 Use underline 5 Flash 7 reverse white display 8 invisible
Test:
Print ("\ 033 [1; 31; 40 m string to be colored \ 033 [0 m ")
Result: