support for formatted text in the terminal #1990
-
I have some Python scripts that import the rich module https://pypi.org/project/rich/ to printed coloured text to the terminal for highlights. I've also tried Termcolor (supported by Pyodide) without success. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
Colorama does work. https://pypi.org/project/colorama/ |
Beta Was this translation helpful? Give feedback.
-
Also use of Rich Console API works. This is a neater solution than colorama. https://rich.readthedocs.io/en/stable/console.html How to use: import rich in pyscript.toml from rich.console import Console
console = Console()
console.print(f"{Fore.YELLOW}Hello World!\n") |
Beta Was this translation helpful? Give feedback.
-
The terminal is provided by XTerm and I am afraid if they don't support "this or that" library there is not much we can do if not asking why/how we could support those ... but if I understood correctly your issue is solved with |
Beta Was this translation helpful? Give feedback.
-
Yes, |
Beta Was this translation helpful? Give feedback.
Also use of Rich Console API works. This is a neater solution than colorama.
https://rich.readthedocs.io/en/stable/console.html
How to use:
import rich in pyscript.toml