'Python rich - Can't print text styles, only colors
The problem is that I can't print any text style. This is my code, and I don't think it's faulty:
from rich.console import Console
console = Console(highlight=False)
console.print("Test print")
console.print("[green]Test print (green)")
console.print("[bold]Test print (bold)")
console.print("[bold underline]Test print (bold underline)")
input()
This is what I got after running the script: https://i.stack.imgur.com/1SXwN.png
And this is what I got when I run python -m rich
in the cmd: https://i.stack.imgur.com/68k3p.png
What should I do? I tried it in Windows Terminal (from MS Store), and I got much more color and all the text styles, but I can't set Windows Terminal as default (I have Windows 10, not Windows 11).
Solution 1:[1]
The classic Windows terminal doesn’t support any of the text styles, and only 16 colours.
Solution 2:[2]
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Will McGugan |
Solution 2 | Gerrishon Sirere |