from termcolor import colored
print colored('Hello', 'blue') + ", " + colored('V2EX', 'cyan', attrs=['bold'])
from termcolor import colored
print colored('Hello', 'blue') + ", " + colored('V2EX', 'cyan', attrs=['bold'])
|
caizixianFeb 14, 2015
1
还在想着怎么解决呢,就看到这个库了。
多谢分享 |
|
2
刚好了解一点这个。如果想了解更多,或者需要定制更多的颜色,可以看看这里 http://en.wikipedia.org/wiki/ANSI_escape_code#Codes
实际上使用30–37,40–47可以指定8种颜色,也可以用38;5;(0..255)来指定更多的颜色。 |
|
jamiesunFeb 24, 2015
3
我这几天也折腾呢,自己用原始方法搞了一个,但是windows下不行
https://gist.github.com/f057e65c482889d08331.git |