Colorama for Python, Not returning colored print lines on Windows

前端 未结 7 1560
南笙
南笙 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:44

    That's normal because you do not have ANSI on Windows.

    Try somehting like tendo.colorer and this will enable coloring for all platforms.

    Note: tendo.colorer adds coloring to the logs, but I'm sure you will figure it out on how to use it for other things. If I'm not mistaking just importing it before your code it will fix the problem.

提交回复
热议问题