Created
April 22, 2019 19:42
-
-
Save feluelle/c2ebf6d6d5d6ce394de0643722e7edc0 to your computer and use it in GitHub Desktop.
Enumeration of Colors that are also colored when printed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from enum import Enum | |
class Color(Enum): | |
RED = '\033[31m' | |
GREEN = '\033[32m' | |
YELLOW = '\033[33m' | |
BLUE = '\033[34m' | |
def __repr__(self): | |
return f'{self.value}{self.name}\033[0m' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment