Answers for "how to set colors in python"

1

change color in python

from colorama import *
# install with "pip install coloroma"
init(convert=True)

print(Fore.RED + 'Hello World!')
Posted by: Guest on April-13-2021
3

python color

from colorama import init, Fore, Back, Style
init()

print("normal")
print(Fore.LIGHTYELLOW + "yellow" + Fore.RESET)
print(Back.RED + "red" + Back.RESET)
print(Fore.YELLOW + Back.RED + "both" + Style.RESET_ALL)
print("normal again")



The possible colors are: BLACK, BLUE, CYAN, GREEN, LIGHTBLACK_EX, 
 LIGHTBLUE_EX, LIGHTCYAN_EX, LIGHTGREEN_EX, LIGHTMAGENTA_EX, LIGHTRED_EX, 
 LIGHTWHITE_EX, LIGHTYELLOW_EX, MAGENTA, RED, WHITE, YELLOW
Posted by: Guest on February-22-2021
1

python colours

const (
    ResetAll = "33[0m"

    Bold       = "33[1m"
    Dim        = "33[2m"
    Underlined = "33[4m"
    Blink      = "33[5m"
    Reverse    = "33[7m"
    Hidden     = "33[8m"

    ResetBold       = "33[21m"
    ResetDim        = "33[22m"
    ResetUnderlined = "33[24m"
    ResetBlink      = "33[25m"
    ResetReverse    = "33[27m"
    ResetHidden     = "33[28m"

    Default      = "33[39m"
    Black        = "33[30m"
    Red          = "33[31m"
    Green        = "33[32m"
    Yellow       = "33[33m"
    Blue         = "33[34m"
    Magenta      = "33[35m"
    Cyan         = "33[36m"
    LightGray    = "33[37m"
    DarkGray     = "33[90m"
    LightRed     = "33[91m"
    LightGreen   = "33[92m"
    LightYellow  = "33[93m"
    LightBlue    = "33[94m"
    LightMagenta = "33[95m"
    LightCyan    = "33[96m"
    White        = "33[97m"

    BackgroundDefault      = "33[49m"
    BackgroundBlack        = "33[40m"
    BackgroundRed          = "33[41m"
    BackgroundGreen        = "33[42m"
    BackgroundYellow       = "33[43m"
    BackgroundBlue         = "33[44m"
    BackgroundMagenta      = "33[45m"
    BackgroundCyan         = "33[46m"
    BackgroundLightGray    = "33[47m"
    BackgroundDarkGray     = "33[100m"
    BackgroundLightRed     = "33[101m"
    BackgroundLightGreen   = "33[102m"
    BackgroundLightYellow  = "33[103m"
    BackgroundLightBlue    = "33[104m"
    BackgroundLightMagenta = "33[105m"
    BackgroundLightCyan    = "33[106m"
    BackgroundWhite        = "33[107m"
)
Posted by: Guest on October-21-2020

Code answers related to "how to set colors in python"

Python Answers by Framework

Browse Popular Code Answers by Language