termcolor python

Solutions on MaxInterview for termcolor python by the best coders in the world

showing results for - "termcolor python"
Maria
25 Apr 2020
1# To install termcolor
2pip install termcolor
Ayesha
19 Feb 2017
1import sys
2from termcolor import colored, cprint
3
4text = colored('Hello, World!', 'red', attrs=['reverse', 'blink'])
5print(text)
6cprint('Hello, World!', 'green', 'on_red')
7
8print_red_on_cyan = lambda x: cprint(x, 'red', 'on_cyan')
9print_red_on_cyan('Hello, World!')
10print_red_on_cyan('Hello, Universe!')
11
12for i in range(10):
13    cprint(i, 'magenta', end=' ')
14
15cprint("Attention!", 'red', attrs=['bold'], file=sys.stderr)
16