在 Python 中用 Rich 重置 Table 或删除一行?

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

如何删除 rich 中的一行 table? (擦除行或重置所有 table)

例如。我如何重置 table测试或删除一行?

from rich.console import Console
from rich.table import Table

tableTest = Table(title="Star Wars Movies")

tableTest.add_column("Released", justify="right", style="cyan", no_wrap=True)
tableTest.add_column("Title", style="magenta")
tableTest.add_column("Box Office", justify="right", style="green")

tableTest.add_row("Dec 20, 2019", "Star Wars: The Rise of Skywalker", "2,110,690")
tableTest.add_row("May 25, 2018", "Solo: A Star Wars Story", "3,151,347")
tableTest.add_row("Dec 15, 2017", "Star Wars Ep. V111: The Last Jedi", ",332,539,889")
tableTest.add_row("Dec 16, 2016", "Rogue One: A Star Wars Story", ",332,439,889")

console = Console()
console.print(tableTest)

不,rich 不向 Delete/Remove 行提供任何 API。请参阅此 Support for deleting/removing rows/columns from table 以了解为什么没有将此类 API 添加到 Table class.