×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Python
Posted by: Ivan Shpotenko
Added: Mar 30, 2017 9:23 AM
Modified: Mar 30, 2017 9:23 AM
Views: 2316
Tags: color
  1. from termcolor import colored
  2.  
  3. print('Sometimes I wonder, why all text in terminal is boring, like this one?')
  4. print('Why it lacks {}?'.format(colored('color', 'green', attrs=['bold'])))
  5. print('You know, on the other thought',
  6.       colored('color gives you so', 'green'),
  7.       colored('much', 'green', attrs=['bold']),
  8.       colored('possibilities', 'green')
  9.       )
  10. print(
  11.     colored('Imagine', 'red'),
  12.     colored('you', 'green'),
  13.     colored('can', 'yellow'),
  14.     colored('paint', 'blue', attrs=['bold']),
  15.     colored('the', 'magenta'),
  16.     colored('world', 'cyan', attrs=['bold']),
  17. )
  18. print(
  19.     colored('And', 'red', attrs=['bold']),
  20.     colored('you', 'green', attrs=['dark']),
  21.     colored('can', 'yellow', attrs=['underline']),
  22.     colored('do', 'blue', attrs=['blink']),
  23.     colored('it', 'magenta', attrs=['reverse']),
  24.     colored('again)', 'cyan', attrs=['concealed']),
  25. )
  26. print(
  27.     colored('And', 'red', 'on_grey'),
  28.     colored('you', 'green', 'on_red'),
  29.     colored('can', 'blue', 'on_green'),
  30.     colored('do', 'blue', 'on_yellow'),
  31.     colored('it', 'white', 'on_blue'),
  32.     colored('again', 'cyan', 'on_magenta'),
  33. )
  34.