2014-02-18 92 views

回答

15

爲了使用termcolor在windows終端中使用的ANSI顏色,您還需要導入/ init colorama;

>>> from termcolor import * 
>>> cprint('hello', 'red') 
←[31mhello←[0m 
>>> import colorama 
>>> colorama.init() 
>>> cprint('hello', 'red') 
hello         <-- in red color 
>>> 
相關問題