Last active
February 9, 2022 00:26
-
-
Save thevickypedia/7ca5b232e08c08950d18e905496fb3ce to your computer and use it in GitHub Desktop.
Format text in python's print statements
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
class Format: | |
BOLD = '\033[1m' | |
UNDERLINE = '\033[4m' | |
ITALIC = '\x1B[3m' | |
class Colors: | |
VIOLET = '\033[95m' | |
BLUE = '\033[94m' | |
CYAN = '\033[96m' | |
GREEN = '\033[92m' | |
YELLOW = '\033[93m' | |
RED = '\033[91m' | |
END = '\033[0m' | |
LIGHT_GREEN = '\033[32m' | |
LIGHT_YELLOW = '\033[2;33m' | |
LIGHT_RED = '\033[31m' | |
print(f"{Format.UNDERLINE}{Colors.VIOLET}I will print in 'VIOLET', 'UNDERLINE' text{Colors.END}") | |
print(f"{Format.BOLD}{Colors.BLUE}I will print in 'BLUE', 'BOLD' text{Colors.END}") | |
print(f"{Colors.CYAN}I will print in 'CYAN'{Colors.END}") | |
print(f"{Colors.GREEN}I will print in 'GREEN'{Colors.END}") | |
print(f"{Colors.YELLOW}I will print in 'YELLOW'{Colors.END}") | |
print(f"{Colors.RED}I will print in 'RED'{Colors.END}") | |
print(f"{Colors.LIGHT_RED}I will print in basic 'RED'{Color.END}") | |
print(f"{Colors.LIGHT_YELLOW}I will print in basic 'YELLOW'{Color.END}") | |
print(f"{Colors.LIGHT_GREEN}I will print in basic 'GREEN'{Color.END}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment