I've installed colorama for python. I've imported the module as follows:
import colorama
from colorama import init
init()
from colorama import Fore, Back, Style
print Fore.RED + "My Text is Red"
and it returns the ANSI charaters....
esc[31mMy Text is Red
This isn`t what I expected. Am I doing something wrong.
Thanks.
解决方案
I had this same issue on Windows 7 x64, I finally got the colors working without having to install anything new just by adding the argument convert=True to the init call.
from colorama import init, Fore, Back, Style
init(convert=True)
print(Fore.RED + 'some red text')