Skip to content

Instantly share code, notes, and snippets.

@washal
Created November 15, 2015 17:41
Show Gist options
  • Save washal/6cd4db432fed61a83666 to your computer and use it in GitHub Desktop.
Save washal/6cd4db432fed61a83666 to your computer and use it in GitHub Desktop.
Custom colors and outputs for different types of print messages
# Credits: TrustedSec https://github.com/trustedsec/ptf/blob/master/src/core.py
class bcolors:
PURPLE = '\033[95m'
CYAN = '\033[96m'
DARKCYAN = '\033[36m'
BLUE = '\033[94m'
GREEN = '\033[92m'
YELLOW = '\033[93m'
RED = '\033[91m'
BOLD = '\033[1m'
UNDERL = '\033[4m'
ENDC = '\033[0m'
backBlack = '\033[40m'
backRed = '\033[41m'
backGreen = '\033[42m'
backYellow = '\033[43m'
backBlue = '\033[44m'
backMagenta = '\033[45m'
backCyan = '\033[46m'
backWhite = '\033[47m'
def print_status(message):
print bcolors.GREEN + bcolors.BOLD + "[*] " + bcolors.ENDC + str(message)
def print_info(message):
print bcolors.BLUE + bcolors.BOLD + "[-] " + bcolors.ENDC + str(message)
def print_info_spaces(message):
print bcolors.BLUE + bcolors.BOLD + " [-] " + bcolors.ENDC + str(message)
def print_warning(message):
print bcolors.YELLOW + bcolors.BOLD + "[!] " + bcolors.ENDC + str(message)
def print_error(message):
print bcolors.RED + bcolors.BOLD + "[!] " + bcolors.ENDC + bcolors.RED + str(message) + bcolors.ENDC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment