1.格式: \033[顯示的方式;字體的顏色;背景色m+顯示內容python
#RED = '\033[4;31;0m' + '你好'
#print(RED)ide
class FontColor:
OKBULE = '\033[94m'
OKGREEN = '\033[92m'
WARN = '\033[93m'
FAIL = '\033[91m'字體
if name == 'main':
f = FontColor()
print(f.OKBULE + '你好')
print(f.OKGREEN + '你好')
print(f.WARN + '你好')
print(f.FAIL + '你好')blog