Python
Python

How do you create real-time progress bars and updating tables for professional CLI tools using Python's Rich library?

December 3, 2025

Rich's Live class renders dynamic content (tables, progress, spinners) that auto-refreshes without flicker. Combine Progress for task tracking + Table for live metrics. Live.update() triggers re-render at 60fps. Perfect for ETL jobs, downloads, system monitors. Zero curses complexity, works on Windows/Linux/Mac.

Code

from rich.live import Live
from rich.table import Table
from rich.progress import Progress, SpinnerColumn, TextColumn
import time

# Live updating dashboard
def create_table() -> Table:
    table = Table(title="System Monitor")
    table.add_column("CPU", style="cyan")
    table.add_column("Memory", style="magenta")
    table.add_column("Tasks", style="green")
    return table

with Live(create_table(), refresh_per_second=4) as live:
    progress = Progress(SpinnerColumn(), TextColumn("[progress.description]{task.description}"))
    task = progress.add_task("Processing...", total=1000)
    
    for i in range(1000):
        # Update table live
        table = create_table()
        table.add_row(f"{i*0.1:.0f}%", f"{i*2}MB", f"{i+10}")
        live.update(table)
        
        # Update progress
        progress.update(task, advance=1, description=f"Step {i+1}/1000")
        time.sleep(0.02)

print(" Complete!")
      
Hire Now!

Need Help with Python Development ?

Ready to leverage the power of conversational AI? Start your project with Zignuts expert AI developers.
bg-image
download-image
Company Deck
PDF, 3MB
© 2026 Zignuts Technolab. All Rights Reserved.
branch imagesbranch imagesbranch imagesbranch imagesbranch imagesbranch images