python 输出彩色

def print_Red(str): print '\033[1;41m %s \033[1;m' %str def print_Green(str): print '\033[1;42m %s \033[1;m' %str def print_Brown(str): print '\033[1;43m %s \033[1;m' %str def print_Blue(str): print '\033[1;44m %s \033[1;m' %str def print_Magenta(str): print '\033[1;45m %s \033[1;m' %str def print_Cyan(str): print '\033[1;46m %s \033[1;m' %str def print_Gray(str): print '\033[1;47m %s \033[1;m' %str def print_Crimson(str): print '\033[1;48m %s \033[1;m' %str str='yangqilong' print_Red(str) print_Gray(str) print_Green(str) print_Blue(str) print_Cyan(str) print_Magenta(str) print_Crimson(str) print_Brown(str) http://space.itpub.net/22664653/viewspace-718904
原文地址:https://www.cnblogs.com/fengidri/p/2757505.html