import curses def main(stdscr): stdscr.clear() i = 'c' while i != 'q': i = stdscr.getkey() curses.wrapper(main)