Python Curses

From Wiki
Jump to navigation Jump to search

Reference

Example

#!/usr/bin/python
import curses

def main(screen):
    screen.addstr("Hi there!\n")
    screen.addstr("Press Q to quit: ")
    while 1:
        c = screen.getch()
        if c == ord('q'): break
    curses.endwin()

if __name__ == '__main__':
    curses.wrapper(main)