daily pastebin goal
54%
SHARE
TWEET

Untitled

a guest Dec 9th, 2018 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import curses
  2. stdscr = curses.initscr()
  3. curses.cbreak()
  4. stdscr.keypad(1)
  5.  
  6. stdscr.addstr(0,10,"Hit 'q' to quit")
  7. stdscr.refresh()
  8.  
  9. key = ''
  10. while key != ord('q'):
  11.     key = stdscr.getch()
  12.     stdscr.addch(20,25,key)
  13.     stdscr.refresh()
  14.     if key == curses.KEY_UP:
  15.         stdscr.addstr(2, 20, "Up")
  16.     elif key == curses.KEY_DOWN:
  17.         stdscr.addstr(3, 20, "Down")
  18.  
  19. curses.endwin()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top