简体   繁体   中英

Using Colorama on Python 3.7 on Windows 10

I am trying to get a portion of my code to print out in color using colorama. I have:

from colorama import init, Fore, Style
init(convert=True)
print(Fore.RED + 'Hello')

but the code output has no color change. What am I doing wrong?

It works without init(convert=True). you should use init()

from colorama import init, Fore, Style
init()
print(Fore.RED + 'Hello')

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM