Modern Text User Interface framework for building cross-platform terminal and web applications with Python
Overall
score
93%
Build a simple task counter TUI application that tracks completed and pending tasks using reactive programming.
Create a terminal application that displays:
The application should update all displays automatically when task counts change. When a user presses the 'c' key, it should increment the completed count. When a user presses the 'p' key, it should increment the pending count. Pressing 'q' should quit the application.
The completion percentage should be calculated automatically based on the completed and pending counts, formatted as "X.X%" (one decimal place). If there are no tasks, display "0.0%".
Implement this using reactive attributes that automatically update dependent values and trigger UI refreshes when changed.
@generates
"""Task counter application using reactive programming."""
from textual.app import App
class TaskCounterApp(App):
"""A TUI app that tracks task counts with reactive updates."""
def compose(self):
"""Compose the UI widgets."""
passProvides the TUI framework with reactive programming support.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/pypi-textualevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10