question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[QUESTION]The live module can't refresh as expected.

See original GitHub issue

Hi there. I want to use rich.live module to show something in real time and I test it with your sample code.

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")

However, it did’t refresh, just show the final result for me. Could you give me some ideas how to use this module correctly?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
DarrenIcecommented, Dec 4, 2020

As a quick work around

In powershell run:

$env:TERM="SMART"

Then re-run the initial code.

Thanks a lot, it works!

0reactions
DarrenIcecommented, Dec 4, 2020

Thanks for diagnosing that @nathanrpage97

is_dumb_terminal will be True if TERM is set to “dumb” or “unknown”. As far as I know, this convention should apply to Windows.

@DarrenIce Do you recall adding the TERM environment variable? Could have been a workaround for an app that broken on Windows.

Yes, I add two lines in my code, and now it can work as expect.

self.console = Console(force_terminal=True,color_system='truecolor')
self.console._environ['TERM'] = 'SMART'   
Read more comments on GitHub >

github_iconTop Results From Across the Web

[QUESTION]The live module can't refresh as expected. · Issue #465 ...
Hi there. I want to use rich.live module to show something in real time and I test it with your sample code. import...
Read more >
Live reload stopped working after Angular 8 update
After upgrading Angular from 7 to 8, the live reload stopped working. Everything went well during the update and I have no compilation ......
Read more >
OWA redirection doesn't work after installing November 2021 ...
In an Exchange deployment that spans multiple Active Directory (AD) sites that use different URLs to access OWA (for example, site 1 =...
Read more >
Known Issues · Sandbox - Trailblazer Community - Salesforce
A known issue is sometimes causing data required by the login functionality to not copied as expected, as a result post refresh when...
Read more >
Testing & Editing Active Surveys - Qualtrics
A limitation of this question type is that you cannot update the answer choices after you have collected responses without invalidating the previously...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found