Skip to content

Instantly share code, notes, and snippets.

@timotree3
Created February 12, 2016 17:12
Show Gist options
  • Save timotree3/328734ea252af84f83db to your computer and use it in GitHub Desktop.
Save timotree3/328734ea252af84f83db to your computer and use it in GitHub Desktop.
Display ANSI formatting
print('\033[1;37m This is normal')
print("")
for attr in range(0,8):
for fg in range(30,38):
print('')
print('\033[1;37m default ',end="")
for bg in range(40,48):
print('\033['+ str(attr) +';'+ str(bg) +';'+ str(fg) +'m ' \
+str(attr)+';'+str(fg)+';'+str(bg)+'\033[m ',end="")
print("")
print('\033[1;37m This is back to normal')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment