Colorama for Python, Not returning colored print lines on Windows

前端 未结 7 1567
南笙
南笙 2020-12-01 18:16

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,          


        
7条回答
  •  一生所求
    2020-12-01 18:38

    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')
    

提交回复
热议问题