Created
April 4, 2018 00:39
-
-
Save hvgab/9cb6563b55761521d60f7add4d21b0e4 to your computer and use it in GitHub Desktop.
try import colorama
This file contains hidden or 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
| # *if* colorama is installed, get colors | |
| try: | |
| from colorama import Fore, Back, Style, init | |
| init(autoreset=True) | |
| # fallback so that the imported classes always exist | |
| except ImportError: | |
| class ColorFallback(): | |
| __getattr__ = lambda self, name: '' | |
| Fore = Back = Style = ColorFallback() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment