wtpython
wtpython copied to clipboard
Setup Rich Styles for output formatting
We should try to create styles like the following to make things a bit more consistent across the application
from rich.console import Console
from rich.theme import Theme
custom_theme = Theme({
"info" : "dim cyan",
"warning": "magenta",
"danger": "bold red"
})
console = Console(theme=custom_theme)
console.print("This is information", style="info")
console.print("[warning]The pod bay doors are locked[/warning]")
console.print("Something terrible happened!", style="danger")
https://rich.readthedocs.io/en/stable/style.html
Does this also sync with the colours textual uses?