Skip to content

Instantly share code, notes, and snippets.

@samduy
Created July 12, 2018 08:07
Show Gist options
  • Save samduy/74a87cae867eef07e55632488a6f7717 to your computer and use it in GitHub Desktop.
Save samduy/74a87cae867eef07e55632488a6f7717 to your computer and use it in GitHub Desktop.
Print with colors in python
#!/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