Skip to content

Instantly share code, notes, and snippets.

@alfawal
Created March 25, 2023 04:13
Show Gist options
  • Save alfawal/34f9620cfb7825d028969625421563f8 to your computer and use it in GitHub Desktop.
Save alfawal/34f9620cfb7825d028969625421563f8 to your computer and use it in GitHub Desktop.
Python colors class
class Colors:
INFO = "\033[94m"
SUCCESS = "\033[92m"
WARNING = "\033[93m"
ERROR = "\033[91m"
YELLOW = "\033[33m"
PURPLE = "\033[95m"
SKY_BLUE = "\033[96m"
RESET = "\033[0m"
print(
Colors.ERROR + "Error",
Colors.WARNING + "Warning",
Colors.SUCCESS + "Success",
Colors.PURPLE + "Purple",
Colors.SKY_BLUE + "Sky Blue",
Colors.INFO + "Info",
Colors.YELLOW + "Yellow",
Colors.RESET + "Reset",
sep="\n",
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment