Skip to content

Instantly share code, notes, and snippets.

@kkroesch
Last active June 4, 2022 21:57
Show Gist options
  • Save kkroesch/40e26a3a6033898a20d1 to your computer and use it in GitHub Desktop.
Save kkroesch/40e26a3a6033898a20d1 to your computer and use it in GitHub Desktop.
Color definitions for console output.
DOUBLE_LINE = '=' * 80
OUTPUT_TEMPLATE = "{0:32}{1:>6}"
DEVICE_TEMPLATE = "{0:35}{1:22}{2:>12}"
CHECK_SIGN = u'✔'.encode('utf-8')
FAIL_SIGN = u'✘'.encode('utf-8')
class Colors:
""" Colors for console putput as ANSI code.
Example usage:
exit(Colors.ERROR.format('Error: API token not given.'))
print(Colors.OKGREEN.format("All went fine.")
"""
HEADER = '\033[95m{}\033[0m'
OKBLUE = '\033[94m{}\033[0m'
OKGREEN = '\033[92m{}\033[0m'
ERROR = '\033[91m{}\033[0m'
WARNING = '\033[93m{}\033[0m'
FAIL = '\033[91m{}\033[0m'
BOLD = '\033[1m{}\033[0m'
UNDERLINE = '\033[4m{}\033[0m'
ENDC = '\033[0m'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment