Last active
November 14, 2021 00:52
-
-
Save BenRogersWPG/81d4bb5e637929908037acb50c7f5249 to your computer and use it in GitHub Desktop.
Colorful Python 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
#Print a line to the console in red text: | |
print(f'\033[31mThis is red text\033[0m') | |
#Print a line to the console in green text: | |
print(f'\033[32mThis is green text\033[0m') | |
#Print a line to the console in yellow text: | |
print(f'\033[33mThis is yellow text\033[0m') | |
#Print a line to the console in blue text: | |
print(f'\033[34mThis is blue text\033[0m') | |
#Print a line to the console in magenta text: | |
print(f'\033[35mThis is magenta text\033[0m') | |
#Print a line to the console in white text: | |
print(f'\033[37mThis is white text\033[0m') | |
#Print a line to the console in black text: | |
print(f'\033[30mThis is black text\033[0m') | |
#Print a line to the console in highlighted text: | |
print(f'\033[41mThis is highlighted text\033[0m') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment