Skip to content

Instantly share code, notes, and snippets.

@MaxVRAM
Created June 15, 2021 10:46
Show Gist options
  • Save MaxVRAM/14ba1902fd0808769941f7368e5f71a8 to your computer and use it in GitHub Desktop.
Save MaxVRAM/14ba1902fd0808769941f7368e5f71a8 to your computer and use it in GitHub Desktop.
A Python utility script for printing console logs with tierable success/failure options
def print_blank(num_lines = 1):
for x in range(num_lines):
print("")
def print_break():
print(bcolors.DARK + "---------------------------------------------------------------------------------------" + bcolors.ENDC)
def print_info(text, tier=0):
offset = ''.ljust(tier * 3)
print(offset + bcolors.ENDC + " [-] " + str(text))
def print_header(text, tier=0):
offset = ''.ljust(tier * 3)
print(offset + bcolors.OKBLUE + str(text) + bcolors.ENDC)
def print_success(text, tier=0):
offset = ''.ljust(tier * 3)
print(offset + " [" + bcolors.OKGREEN + "✓" + bcolors.ENDC + "] " + str(text))
def print_warning(text, tier=0):
offset = ''.ljust(tier * 3)
print(offset + " [" + bcolors.WARNING + "!" + bcolors.ENDC + "] " + str(text))
def print_error(text, tier=0):
offset = ''.ljust(tier * 3)
print(offset + " [" + bcolors.FAIL + "✗" + bcolors.ENDC + "] " + text)
def print_check(result, text):
if result is True:
print_success(text)
else:
print_error(text)
class bcolors:
HEADER = '\033[95m'
DARK = '\033[90m'
OKBLUE = '\033[94m'
OKCYAN = '\033[96m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment