Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error printing colored text
#1
print('\033[31m' + 'Hello' + '\033[0m')  # this prints 'hello' in red text
So when I run this in Pycharm it works and prints out 'hello' in red text like I want it to.

But when I run the python file on my computer (so I just run the file, outside Pycharm), this is the output:

Hello

So it doesn't print the red text. Does anybody know why this is, and how to solve it?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How do I classify colored images into 3 classes max22 0 672 Dec-04-2023, 10:33 PM
Last Post: max22
Question Colored text Alivegamer 3 2,099 Feb-28-2022, 02:43 AM
Last Post: BashBedlam
  fontforge Emoji encoding and colored glyphs pauf28 0 2,148 Dec-22-2020, 10:05 AM
Last Post: pauf28
  cx_Oracle.DatabaseError: Error while trying to retrieve text from error ORA-01804 rajeshparadker 0 8,636 Nov-12-2020, 07:34 PM
Last Post: rajeshparadker
  colored input() Trianne 6 18,567 Oct-15-2018, 07:50 PM
Last Post: wavic
  Printing lines in a basic text file Drone4four 6 3,853 Aug-16-2018, 03:10 PM
Last Post: snippsat
  printing text tables with consistent width Skaperen 7 10,672 Jul-01-2018, 02:34 AM
Last Post: Skaperen
  Printing from a text file not working as I thought it would PythonZenon 10 6,057 Jun-02-2018, 09:19 PM
Last Post: snippsat
  printing a text file by python and thermal printer gray 6 20,590 Jul-30-2017, 05:56 AM
Last Post: buran
  getting current filename of a text editor file for printing file name? hsunteik 3 5,037 Dec-24-2016, 07:58 PM
Last Post: Blue Dog

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020