Last active
August 29, 2015 14:10
-
-
Save adrianmoses/397d170da8833b5c4d9e to your computer and use it in GitHub Desktop.
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
def color_wrap(msg, color='blue'): | |
end_color = '\033[0m' | |
color_dict = { | |
'blue': '\033[94m', | |
'green': '\033[92m', | |
'yellow': '\033[93m', | |
'red': '\033[91m', | |
'purple':'\033[95m' | |
} | |
color = color_dict.get(color) | |
return color + msg + end_color | |
print(color_wrap("hello!", color='green')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment