I hereby claim:
- I am adrian-the-git on github.
- I am adriancarpenter (https://keybase.io/adriancarpenter) on keybase.
- I have a public key whose fingerprint is 5590 0259 8B73 97C9 2099 3FFD C554 970F 409D 496E
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
# If you can write a simpler but still *readable* cross-platform colored text print function please comment! | |
try: | |
from ctypes import windll | |
BLUE, GREEN, CYAN, RED, MAGENTA, YELLOW, GRAY, BOLD, RESET = [*range(1, 9), 7] | |
set_color = (lambda a, b, f=windll.kernel32.SetConsoleTextAttribute, | |
s=windll.kernel32.GetStdHandle(-11): f(s, a | b)) | |
except ImportError: | |
RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, GRAY, BOLD, RESET = [*range(31, 38), 1, 0] |