Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Colored text
#1
Question 
I've been looking on how to change your text in the command when you run python.
class Colors:
    RED = "\x1b[0;31;40"

def Starting():
    print(Colors.RED + "Hello")
    time.sleep(100)
This is my code that I thought would work to change my text red but it shows this.

←[0;31;40Hello

What am I doing wrong?
Reply


Messages In This Thread
Colored text - by Alivegamer - Feb-27-2022, 08:55 PM
RE: Colored text - by deanhystad - Feb-28-2022, 12:23 AM
RE: Colored text - by bowlofred - Feb-28-2022, 02:22 AM
RE: Colored text - by BashBedlam - Feb-28-2022, 02:43 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How do I classify colored images into 3 classes max22 0 716 Dec-04-2023, 10:33 PM
Last Post: max22
  fontforge Emoji encoding and colored glyphs pauf28 0 2,197 Dec-22-2020, 10:05 AM
Last Post: pauf28
  Error printing colored text julio2000 0 1,512 Feb-02-2020, 07:04 PM
Last Post: julio2000
  colored input() Trianne 6 18,701 Oct-15-2018, 07:50 PM
Last Post: wavic

Forum Jump:

User Panel Messages

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