📜  如何使用 colorama - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:27.875000             🧑  作者: Mango

代码示例2
# Colorama is a module to color the python outputs
# 1. You have to install python with pip
# 2. go to your commandline and type:
#    linux: sudo pip install colorama
#    windows + mac: pip install colorama
# 3. wait for the download and then create a new python file
# 4. use the module colorama
import colorama
from colorama import Fore, Back, Style
# 5. the best way is to use colorama with f-strings
colorama.init(autoreset=True)#auto resets your settings after every output

print(f"{Fore.GREEN}green is one of the colors, there are many other colors!")