Skip to content
Advertisement

Tag: rich

Reset a Table with Rich in Python, or delete a row?

How could I erase a row table in rich? (Erase the rows or reset all the table) ex. How could I reset tableTest or erase a row? Answer No, rich does not provide any APIs to Delete/Remove the rows. See this Support for deleting/removing rows/columns from table to understand why no such APIs are added to the Table class.

How to highlight in rich.prompt.Prompt

I have this highlighter If I do something like console.print() it gives the custom highlighting but it dosen’t give custom highlighting for rich.prompt.Prompt.ask() How can I get the highlighter for rich.prompt.Prompt.ask() Answer Are you expecting the text you enter to be highlighted as you type? Rich doesn’t have that capability. You might want to look in to prompt_toolkit for that.

Advertisement