Python Forum
colorama/termcolor not returning coloured lines
Thread Rating:
  • 2 Vote(s) - 1.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
colorama/termcolor not returning coloured lines
#4
On windows you need to call init(). On other platforms it's simply ignored if present

from colorama import Fore, Back, Style, init
init()
print(Fore.RED + 'some red text')
print(Back.GREEN + 'and with a green background')
print(Style.DIM + 'and in dim text')
print(Style.RESET_ALL)
print('back to normal now')
run this from cmd, not in IDLE
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
RE: colorama/termcolor not returning coloured lines - by buran - Jan-14-2019, 12:57 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Iterate 2 large text files across lines and replace lines in second file medatib531 13 5,920 Aug-10-2020, 11:01 PM
Last Post: medatib531
  f-strings and termcolor newbieAuggie2019 6 11,773 Jul-28-2020, 02:50 AM
Last Post: santarosajoe
  Coloured text in the terminal works in Linux but not Windows Flexico 2 2,719 Aug-26-2019, 10:44 PM
Last Post: Flexico

Forum Jump:

User Panel Messages

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