Created
July 12, 2018 08:07
-
-
Save samduy/74a87cae867eef07e55632488a6f7717 to your computer and use it in GitHub Desktop.
Print with colors in python
This file contains hidden or 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
#!/usr/bin/env python | |
# Ref: https://stackoverflow.com/questions/287871/print-in-terminal-with-colors | |
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 bcolors.WARNING + "Warning: 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