Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to print a colored message using the below code. I am able to print the message but not in color. Kindly help me finding out the issue.

What I have tried:

from pyfiglet import figlet_format
from termcolor import colored

msg =input("Enter the message you want to dispaly ")
colour = input("Enter the colour you wish ")

art = figlet_format(msg)
colored_art= colored(art, color=colour)
print(colored_art)
Posted
Comments
Bryian Tan 12-Aug-18 21:57pm    
What terminal the code is running on?
Guru Deshmukh 12-Aug-18 22:19pm    
Windows PowerShell
Bryian Tan 12-Aug-18 23:41pm    
just curious, did it print out the color character? something like [31mhello when execute print (colored('hello', 'red'))
Guru Deshmukh 13-Aug-18 9:51am    
Yes, it did print the text in exact way([31mhello) but it was not colored.
Bryian Tan 13-Aug-18 10:46am    
try the colorama package https://pypi.org/project/colorama/

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900