day27- console output colored text

Format: \ 033 [display; foreground; background color m 

Description: 
Display Meaning
-------------------------
  0 default setting terminal
  1 High highlight
  4 with an underscore
  5 scintillator
  7 highlight
  8 invisible

-------------------------
foreground color background color ------ --------------------------------- 30 40 black 31 is 41 is red 32 42 is green 33 is 43 is yellow 34 is 44 is blue 35 45 purple 36 46 is cyan 37 [ 47 White # example: \ 033 [. 1; 31 is; 40m l- 31- foreground red highlight background color black 40
\ 033 [0m terminal using the default settings, the color setting is canceled

print ( '\ 033 [31m continue its efforts to uphold forward \ 033 [0m') 
Print ( '\ 033 [0; 32; 40m to continue efforts to uphold the forward \ 033 [0m')

Print ( '\ 033 [0; Moonlight 36m, ')
Print (' suspected ground frost. ')
Print (' lift eyes to the moon, ')
Print (' bow think of home. \ 033 [0m ')
 
  
 


 

Guess you like

Origin www.cnblogs.com/python-daxiong/p/11343684.html