Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Screen
✓ from asciimatics.screen import Screen
✗ from asciimatics import Screen
Screen is in the screen subpackage, not at top level
Frame
✓ from asciimatics.widgets import Frame
✗ from asciimatics import Frame
Frame is in widgets subpackage since 1.13.0
Scene
✓ from asciimatics.scene import Scene
✗ from asciimatics import Scene
Scene is in the scene subpackage
Effect
✓ from asciimatics.effects import Effect, ...
✗ from asciimatics import Effect
Effects are in the effects subpackage
Sprite
✓ from asciimatics.sprites import Sprite
✗ from asciimatics import Sprite
Sprites are in the sprites subpackage
Label, Button, Text, Layout
✓ from asciimatics.widgets import Label, Button, Text, Layout
✗ from asciimatics import Label
All widgets are in the widgets subpackage since 1.13.0
Simple hello world using FigletText. Run with Python; creates a full-screen animation.
# Demo: bouncing ball animation
import os
from asciimatics.screen import Screen
from asciimatics.scene import Scene
from asciimatics.effects import Effect
from asciimatics.renderers import FigletText
def demo(screen):
renderer = FigletText("Hello")
effects = [
Effect(screen, 0, 0, renderer, delete=False)
]
scene = Scene(effects, -1, name="Hello")
screen.play([scene], stop_on_resize=True)
Screen.wrapper(demo)
Errors
Common errors & fixes
AttributeError: module 'asciimatics' has no attribute 'Screen'
Incorrect import path: `from asciimatics import Screen`.
fixUse `from asciimatics.screen import Screen`.
ModuleNotFoundError: No module named 'asciimatics.screen'
Old version of asciimatics (<1.13.0) where widgets were not yet a subpackage, OR missing parentheses in import with Python 3.
fixUpdate to latest version: pip install --upgrade asciimatics.
TypeError: __init__() missing 1 required positional argument: 'screen'
Custom Effect not passing screen to parent class. Since 1.9.0, screen is mandatory for Effect.
fixEnsure custom Effect __init__ calls super().__init__(screen, *args, **kwargs) and passes screen parameter.
Termux: 'os' has no attribute 'kill' / screen_width not found
Asciimatics does not fully support Android/Termux without extra terminal emulation.
fixUse a different terminal or run on desktop OS (Linux, macOS, Windows).
Upgrade
Version history
1.15.0latest on PyPI · released Oct 25, 2023
Audit
Dependencies
PillowoptionalImage conversion and sprite loading
pynputoptionalMouse handling on some platforms (optional)
winitAPIoptionalWindows console API (optional, Windows only)