Python Terminal UI
There are some libraries for this:
curses which is python frontend to ncurses (tutorial)
urwid (tutorial)
npyscreen
python-prompt-toolkit
curtsies
asciimatics
picotui
Xabos