Back

Explore Courses Blog Tutorials Interview Questions
0 votes
3 views
in Python by (12.7k points)
How might I yield a coloured text to the terminal in Python?

1 Answer

0 votes
by (26.4k points)

There is a python termcolor module, where the usage is simple:

from termcolor import colored

print colored('hello', 'red'), colored('world', 'green')

In case of Python 3,

print(colored('hello', 'red'), colored('world', 'green'))

Want to become a expert in Python? Join the python course fast!

Related questions

+2 votes
2 answers
0 votes
1 answer
0 votes
1 answer

Browse Categories

...