Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Colored text
#2
Where did you get that code? I am used to seeing ansii color codes that look like this: \033[1;32m, \e[1;32m or \x1b[1;31m. I've never seen a code with two semicolons.

You can use the colorama module.
from colorama import Fore

print(Fore.RED + "This is red", Fore.GREEN + "This is green")
This is a bit easier to read than obscure escape sequences.
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 752 Dec-04-2023, 10:33 PM
Last Post: max22
  fontforge Emoji encoding and colored glyphs pauf28 0 2,231 Dec-22-2020, 10:05 AM
Last Post: pauf28
  Error printing colored text julio2000 0 1,533 Feb-02-2020, 07:04 PM
Last Post: julio2000
  colored input() Trianne 6 18,849 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