ASCIIMATICS

Agenda:

  • Introduction.
  • Features.
  • Installation.
  • How to use it.

Asciimatics is a package to help people create full-screen text UIs on any platform.

  • Coloured/styled text - including 256 colour terminals.
  • Cursor positioning.
  • Keyboard input.
  • Mouse input.
  • Detecting and handling when the console resizes.
  • Screen Scraping.

Installation

To install asciimatics, simply install with pip as follows:
$ pip install asciimatics

How to use it?

from random import randint
from asciimatics.screen import Screen

def demo(screen):
    while True:
        screen.print_at('Hello world!',
                        randint(0, screen.width), randint(0, screen.height),
                        colour=randint(0, screen.colours - 1),
                        bg=randint(0, screen.colours - 1))
        ev = screen.get_key()
        if ev in (ord('Q'), ord('q')):
            return
        screen.refresh()

Screen.wrapper(demo)
Documentation:
More examples:
Contributing to the project:

Asciimatics

By Aditya Ramteke

Asciimatics

April Python Pune Meetup 2018

  • 134