Click here to Skip to main content
13,665,440 members
Rate this:
Please Sign up or sign in to vote.
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)
Posted 12-Aug-18 7:13am
Bryian Tan 12-Aug-18 21:57pm
What terminal the code is running on?
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'))
5 days ago
Yes, it did print the text in exact way([31mhello) but it was not colored.
Bryian Tan 5 days ago
try the colorama package
Richard MacCutchan 13-Aug-18 3:32am
Normal print statements will likely not work since they do not understand formatting, and will not send the correct control sequences to the screen. You need to check the documentation for these packages.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Cookies | Terms of Service
Web04-2016 | 2.8.180810.1 | Last Updated 12 Aug 2018
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100