How to output python with color
This article mainly introduces python how to take color output, the article is very detailed, has a certain reference value, interested friends must read it!
Format:\ 033 [display mode; foreground color; background color m
Description:
Foreground color background color
-
30 40 black
31 41 Red
32 42 Green
33 43 shades
34 44 Blue
35 45 purplish red
36 46 turquoise
37 47 White
Display mode meaning
-
0 terminal default settings
1 highlight
4 use underscore
5 flicker
7 anti-white display
8 not visible
Example:
\ 033 [1x 31x 40m 1: highlight 31: foreground color red 40: background color black-
\ 033 [0m uses the terminal default setting, that is, cancels the color setting
Generally, the output font color is set to\ 033 [31 [31] 1m highlighted text content\ 033 [0m]
The above is all the content of the article "how to output python with Color". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!