Created
July 13, 2010 15:58
-
-
Save brutasse/474080 to your computer and use it in GitHub Desktop.
Colorized shell output, some useful constants…
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
# Font colors # | |
BLACK = '\x1b[30m' | |
RED = '\x1b[31m' | |
GREEN = '\x1b[32m' | |
YELLOW = '\x1b[33m' | |
BLUE = '\x1b[34m' | |
PURPLE = '\x1b[35m' | |
PALE_BLUE = '\x1b[36m' | |
WHITE = '\x1b[37m' | |
# Background colors # | |
RED_BG = '\x1b[41m' | |
GREEN_BG = '\x1b[42m' | |
YELLOW_BG = '\x1b[43m' | |
BLUE_BG = '\x1b[44m' | |
PURPLE_BG = '\x1b[45m' | |
PALE_BLUE_BG = '\x1b[46m' | |
WHITE_BG = '\x1b[47m' | |
# Font effects # | |
BOLD = '\033[1m' | |
ITALICS = '\033[3m' | |
UNDERLINE = '\033[4m' | |
BLINK = '\033[5m' | |
HIGHIGHTED = '\033[7m' | |
END = '\033[0m' | |
if __name__ == '__main__': | |
print GREEN + "It works!" + END, RED + "Yay!" + END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment