Python Terminal/Text UI (TUI) library
Try using the curses module.
Here's an introduction.
There is some libraries for that:
- curses which is python frontend to ncurses (tutorial)
- urwid (tutorial)
- npyscreen
- python-prompt-toolkit
- curtsies
- asciimatics
- picotui