简体   繁体   English

在 Windows 10 上的 Python 3.7 上使用 Colorama

[英]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.我正在尝试使用 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).它在没有 init(convert=True) 的情况下工作。 you should use init()你应该使用 init()

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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