SIGN IN SIGN UP
Textualize / rich UNCLAIMED

Rich is a Python library for rich text and beautiful formatting in the terminal.

55908 0 0 Python
2021-09-24 09:41:23 +01:00
"""
Demonstrates Rich tracebacks for recursion errors.
Rich can exclude frames in the middle to avoid huge tracebacks.
"""
from rich.console import Console
def foo(n):
return bar(n)
def bar(n):
return foo(n)
console = Console()
try:
foo(1)
except Exception:
console.print_exception(max_frames=20)