spyder-ide/spyder

Spyder IPython console not compatible with Textualize/rich Live Tables

ma-sadeghi opened this issue · 3 comments

The following snippet is supposed to generate a table that gets dynamically updated (new row being added every 0.4 seconds). However, Spyder's IPython console prints out a new table every 0.4 seconds, whereas in a regular IPython console or in terminal, the table is only rendered once, but updated every 0.4 seconds.

import time

from rich.live import Live
from rich.table import Table

table = Table()
table.add_column("Row ID")
table.add_column("Description")
table.add_column("Level")

with Live(table, refresh_per_second=4):  # update 4 times a second to feel fluid
    for row in range(12):
        time.sleep(0.4)  # arbitrary delay
        # update the renderable internally
        table.add_row(f"{row}", f"description {row}", "[red]ERROR")

Regular IPython

IPython

Spyder's IPython

Spyder

Hi @ma-sadeghi thank you for the feedback. What happens if you test this with QtConsole? Let us know!

@dalthviz Same thing as with Spyder (table being re-rendered, and not properly updated).

Thanks for checking @ma-sadeghi I will mark this as upstream then