Skip to content

Instantly share code, notes, and snippets.

@awagner83
Created June 19, 2012 13:13
Show Gist options
  • Save awagner83/2954077 to your computer and use it in GitHub Desktop.
Save awagner83/2954077 to your computer and use it in GitHub Desktop.
Colors!
RED, GREEN, YELLOW, BLUE = range(1, 5)
def as_color(color, text):
COLOR_SEQ = "\033[%dm"
return "%s%s%s" % (COLOR_SEQ % (30 + color), text, COLOR_SEQ % 0)
print "FOO"
print as_color(RED, "AHH!")
print "BAR"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment