python prints out the print colors specified font

 

Word = "you love life, life loves you." "

print ( "\ 033 [1; 31m Zhang \ 033 [32m" + word1 [ 1:10] + "\ 033 [1; 31m Joe Smith") # "" 033 [1 : 31m need to change the color of the font  \ 033 " The expression "format 31 indicates the color (30 black, 31 red, 32 green, 33 yellow, 34 blue, magenta 35, cyan 36, white 37; 40 expression begins background color: black 40, 41 red, 42 green, 43 yellow, blue 44, magenta 45, cyan 46, white 47)

Guess you like

Origin www.cnblogs.com/wangjingye/p/12160309.html