rich
UtilitiesTerminal styling
What is rich?
Rich is a Python library for writing rich text to the terminal. It supports markdown rendering, syntax highlighting, tables, progress bars, pretty-printed tracebacks, and a wide range of other formatting options — all with a simple, expressive API.
In PyRun's terminal, Rich's styling comes through as formatted output, making it an excellent tool for building well-presented CLI output. Whether you're building a data reporting script or simply want nicer print statements, Rich works out of the box via micropip with no installation required.
Code Example
Styled panels and tables using the Rich library.
from rich.console import Console
from rich.table import Table
from rich.panel import Panel
console = Console()
console.print(Panel.fit("[bold green]Welcome to PyRun[/bold green]", border_style="green"))
table = Table(title="Top Programming Languages")
table.add_column("Rank", justify="center", style="cyan", no_wrap=True)
table.add_column("Language", style="magenta")
table.add_column("Type", style="green")
table.add_column("Popular For", style="yellow")
table.add_row("1", "Python", "Dynamic", "Data Science, AI")
table.add_row("2", "JavaScript", "Dynamic", "Web, Node")
table.add_row("3", "TypeScript", "Static", "Large-scale Web")
table.add_row("4", "Rust", "Static", "Systems, WASM")
console.print(table)Why run rich in PyRun?
- ✦ Zero setup — no pip install, no virtual environment, no Python download
- ✦ Instant results — powered by WebAssembly, runs locally in your browser
- ✦ Share your code — generate a link and anyone can run it instantly
- ✦ Works offline — after first load, PyRun runs without internet
Related Packages
Recommended Python Resources
Expand your knowledge with related interactive tutorials, cheat sheets, and code comparisons.
Python Loops
Learn how to use Python loops to iterate over data. Master for loops, while loops, break, continue, and loop best practices with interactive examples.
How to Sort a List in Python
Learn how to sort a list in Python using the sort() method and the sorted() function. Discover custom key sorting and reverse order examples.
Python String Methods
A complete reference guide for Python string manipulation. Master formatting, searching, splitting, replacing, and checking string properties.
Python vs JavaScript: Which Programming Language is Best?
A comprehensive comparison between Python and JavaScript. Explore syntax differences, performance, use cases (backend vs frontend), and coding examples.