Skip to content

Instantly share code, notes, and snippets.

@adrianmoses
Last active August 29, 2015 14:10
Show Gist options
  • Save adrianmoses/397d170da8833b5c4d9e to your computer and use it in GitHub Desktop.
Save adrianmoses/397d170da8833b5c4d9e to your computer and use it in GitHub Desktop.
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