Skip to content

Instantly share code, notes, and snippets.

Created February 22, 2012 13:11
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/1885105 to your computer and use it in GitHub Desktop.
Save anonymous/1885105 to your computer and use it in GitHub Desktop.
python curses example
# -*- coding: utf-8 -*-
import curses
def curses_main(args):
w = curses.initscr()
curses.echo()
while 1:
w.addstr(0, 0, ">")
w.clrtoeol()
s = w.getstr()
if s == "q": break
w.insertln()
w.addstr(1, 0, "[" + s + "]")
curses.wrapper(curses_main)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment