Skip to content

Instantly share code, notes, and snippets.

@cesarmiquel
Created September 21, 2012 02:37
Show Gist options
  • Save cesarmiquel/3759457 to your computer and use it in GitHub Desktop.
Save cesarmiquel/3759457 to your computer and use it in GitHub Desktop.
Show console colors
def color(this_color, string):
return "\033[" + this_color + "m" + string + "\033[0m"
for i in range(30, 38):
c = str(i)
print('This is %s' % color(c, 'color ' + c))
c = '1;' + str(i)
print('This is %s' % color(c, 'color ' + c))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment