API Reference

adafruit_dang

A subset of the curses framework. Used for making terminal based applications.

  • Author(s): Jeff Epler, Tim Cocks

Implementation Notes

Hardware:

Software and Dependencies:

class adafruit_dang.Screen(terminal=None)

Curses based Screen class. Can output to CIRCUITPYTHON_TERMINAL or a terminalio.Terminal instance created by code. Supports reading input from sys.stdin

Parameters:

terminal (terminalio.Terminal) – a Terminal instance to output the application to. Default is None which will cause output to CIRCUITPYTHON_TERMINAL.

addstr(y: int, x: int, text: str) None

Add text to the screen at the given location. :param y: y location to add the text at :param x: x location to add the text at :param text: The text to add :return: None

erase() None

Erase the screen. :return: None

getkey() str

Get a key input from the keyboard connected to sys.stdin.

Returns:

The key that was pressed as a literal string, or one of the values in special_keys.

move(y: int, x: int) None

Move the cursor to the specified position. :param y: y position to move the cursor to :param x: x position to move the cursor to :return: None

adafruit_dang.custom_terminal_wrapper(terminal: terminalio.Terminal, func: Callable, *args, **kwds)

Curses wrapper function for terminalio.Terminal instance output :param terminal: The Terminal instance to output to. :param func: The application function to wrap :param args: The arguments to pass the application function :param kwds: The keyword arguments to pass the application function :return: None

adafruit_dang.wrapper(func: Callable, *args, **kwds)

Curses wrapper function for CIRCUITPYTHON_TERMINAL output

Parameters:
  • func – The application function to wrap

  • args – The arguments to pass the application function

  • kwds – The keyword arguments to pass the application function

Returns:

None