LScarpinati

terminal text colors in python

Jan 22nd, 2016
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | None | 0 0
  1. class bcolors:
  2.     HEADER = '\033[95m'
  3.     OKBLUE = '\033[94m'
  4.     OKGREEN = '\033[92m'
  5.     WARNING = '\033[93m'
  6.     FAIL = '\033[91m'
  7.     ENDC = '\033[0m'
  8.     BOLD = '\033[1m'
  9.     UNDERLINE = '\033[4m'
  10.  
  11. # EXAMPLE
  12. print bcolors.WARNING + "Warning: No active frommets remain. Continue?"
  13.       + bcolors.ENDC
Advertisement
Add Comment
Please, Sign In to add comment