4.1. color text - JulTob/Python GitHub Wiki

You can color your code with colorama


from colorama import Fore
from colorama import Style

print(f'{Fore.GREEN}Hello world')
print(f'{Fore.RED}Hello world')
print(f'{Fore.BLUE}Hello world', f'{Fore.BLACK}Hello world')
print(f'{Fore.YELLOW}Hello World')
print(f'{Fore.WHITE}Hello World')
print(f'{Fore.MAGENTA}Hello World')
print(f'{Fore.CYAN}Hello World')

You can also format the text directly

format = '6;30;42m'
end_formating = '\x1b[0m'
print('\x1b['+format + 'Success!' + end_formating)

color table