Skip to content

Instantly share code, notes, and snippets.

@tylerthebuildor
Last active December 16, 2015 15:29
Show Gist options
  • Save tylerthebuildor/5455981 to your computer and use it in GitHub Desktop.
Save tylerthebuildor/5455981 to your computer and use it in GitHub Desktop.
ANSI escape sequences class for coloring bash output.
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
def disable(self):
self.HEADER = ''
self.OKBLUE = ''
self.OKGREEN = ''
self.WARNING = ''
self.FAIL = ''
self.ENDC = ''
# Usage: 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