Skip to content

Instantly share code, notes, and snippets.

@Wegazz
Created March 13, 2020 13:31
Show Gist options
  • Select an option

  • Save Wegazz/02ef43559df6712fec0dff73cf48208f to your computer and use it in GitHub Desktop.

Select an option

Save Wegazz/02ef43559df6712fec0dff73cf48208f to your computer and use it in GitHub Desktop.

Revisions

  1. Wegazz created this gist Mar 13, 2020.
    22 changes: 22 additions & 0 deletions color_print.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    # Цветной вывод текста в консоль Python.
    # print colored text in terminal in Python
    # get from https://stackoverflow.com/questions/287871/how-to-print-colored-text-in-terminal-in-python

    class bcolors:
    HEADER = '\033[95m'
    OKBLUE = '\033[94m'
    OKGREEN = '\033[92m'
    WARNING = '\033[93m'
    FAIL = '\033[91m'
    ENDC = '\033[0m'
    BOLD = '\033[1m'
    UNDERLINE = '\033[4m'


    print(f"{bcolors.HEADER}Header: No active frommets remain. Continue?{bcolors.ENDC}")
    print(f"{bcolors.OKBLUE}Blue: No active frommets remain. Continue?{bcolors.ENDC}")
    print(f"{bcolors.WARNING}Yellow: No active frommets remain. Continue?{bcolors.ENDC}")
    print(f"{bcolors.FAIL}Red: No active frommets remain. Continue?{bcolors.ENDC}")
    print(f"{bcolors.OKGREEN}Green: No active frommets remain. Continue?{bcolors.ENDC}")