Python2 Curses Speed Reader Implementation Notes ================================================ Basic Python-curses skeleton (so terminal doesn't get hosed on abnormal exit): ``` import curses try: screen = curses.initscr() curses.noecho() curses.cbreak() curses.curs_set(0) # Do stuff... finally: curses.nocbreak() curses.echo() curses.endwin() ``` Important functions: ``` screen.clear() # screen wipe screen.addstr(str) # writes str to current screen position screen.addstr(y, x, str) # writes str to (x, y) screen.move(y, x) # moves screen cursor to (y, x) screen.refresh() # draws to the screen --- necessary for every render iteration ``` Documentation and tutorials: https://docs.python.org/2/library/curses.html https://docs.python.org/2/howto/curses.html