Python Curses

From Wiki
Revision as of 22:35, 1 February 2011 by Scott (talk | contribs) (Created page with '== Reference == * Curses library references: http://docs.python.org/lib/module-curses.html * A curses tutorial: http://www.amk.ca/python/howto/curses/curses.html * Another good e…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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)