A cross-platform package to replace curses (mouse/keyboard input & text colours/positioning) and create ASCII animations
81
Create a terminal application that displays multilingual messages with proper text alignment and formatting, supporting Unicode characters including double-width CJK (Chinese, Japanese, Korean) characters.
Your application should:
Create a program that displays the following messages on the terminal screen:
Implement a function that right-aligns text within a specified width, properly accounting for double-width CJK characters:
The application should run for 3 seconds to allow viewing the output, then exit cleanly.
@generates
def display_messages(screen):
"""
Display multilingual messages on the terminal screen.
Args:
screen: The terminal screen object for rendering
"""
pass
def right_align_text(text, width):
"""
Calculate proper spacing for right-aligning text with CJK characters.
Args:
text: The text string containing ASCII and/or CJK characters
width: The total width to align within
Returns:
The number of spaces needed for right alignment
"""
passProvides terminal control and Unicode text support.
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