Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 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
Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers

500 comments

94.1k users

Browse Categories

...