A cross-platform package to replace curses (mouse/keyboard input & text colours/positioning) and create ASCII animations
81
Create a simple terminal-based message logger that displays log messages with automatic scrolling when the screen fills up. The logger should support clearing the screen and maintaining a scrollable view of messages.
Your implementation should create a message logger that:
The logger should accept the following commands:
log <message>: Add a new message to the screen. If the screen is full, scroll to make room.clear: Clear all messages from the screenquit: Exit the programCommand: @generates
class MessageLogger:
"""
A terminal-based message logger with automatic scrolling and clearing.
"""
def __init__(self, screen):
"""
Initialize the message logger.
Args:
screen: The Screen object for terminal control
"""
pass
def log_message(self, message):
"""
Add a message to the logger display.
Automatically scrolls if screen is full.
Args:
message: String message to display
"""
pass
def clear_messages(self):
"""
Clear all messages from the screen.
"""
pass
def display(self):
"""
Render the current state to the screen.
"""
pass
def run(self):
"""
Run the interactive message logger.
Accepts commands: log <message>, clear, quit
"""
passProvides terminal control with screen clearing, scrolling, and rendering support.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/pypi-asciimaticsdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10