Created
September 5, 2019 14:01
-
-
Save solanoepalacio/4ecc4c9fce9ff4de0793f922d9204701 to your computer and use it in GitHub Desktop.
python ansi colors
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 print_format_table(): | |
""" | |
prints table of formatted text format options | |
""" | |
for style in range(8): | |
for fg in range(30,38): | |
s1 = '' | |
for bg in range(40,48): | |
format = ';'.join([str(style), str(fg), str(bg)]) | |
s1 += '\x1b[%sm %s \x1b[0m' % (format, format) | |
print(s1) | |
print('\n') | |
print_format_table() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment