mathy/pi_finder/ui/__init__.py
2025-11-05 12:20:31 +01:00

19 lines
524 B
Python

from __future__ import annotations
import curses
from functools import partial
from typing import Optional
from .app import PiApp
def launch_pi_ui(max_digits: Optional[int] = None) -> None:
"""Launch the curses dashboard for streaming π digits."""
wrapper = partial(_run_curses_app, max_digits=max_digits)
curses.wrapper(wrapper) # type: ignore[arg-type]
def _run_curses_app(stdscr: "curses._CursesWindow", max_digits: Optional[int]) -> None:
app = PiApp(stdscr, max_digits=max_digits)
app.run()