Created
March 13, 2020 13:31
-
-
Save Wegazz/02ef43559df6712fec0dff73cf48208f to your computer and use it in GitHub Desktop.
Print colored text in terminal in Python - Цветной вывод текста в консоль
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Цветной вывод текста в консоль Python. | |
# print colored text in terminal in Python | |
# get from https://stackoverflow.com/questions/287871/how-to-print-colored-text-in-terminal-in-python | |
class bcolors: | |
HEADER = '\033[95m' | |
OKBLUE = '\033[94m' | |
OKGREEN = '\033[92m' | |
WARNING = '\033[93m' | |
FAIL = '\033[91m' | |
ENDC = '\033[0m' | |
BOLD = '\033[1m' | |
UNDERLINE = '\033[4m' | |
print(f"{bcolors.HEADER}Header: No active frommets remain. Continue?{bcolors.ENDC}") | |
print(f"{bcolors.OKBLUE}Blue: No active frommets remain. Continue?{bcolors.ENDC}") | |
print(f"{bcolors.WARNING}Yellow: No active frommets remain. Continue?{bcolors.ENDC}") | |
print(f"{bcolors.FAIL}Red: No active frommets remain. Continue?{bcolors.ENDC}") | |
print(f"{bcolors.OKGREEN}Green: No active frommets remain. Continue?{bcolors.ENDC}") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment