Advertisement
clairec

curses example esr amk

Apr 29th, 2016
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | None | 0 0
  1. from curses import wrapper
  2.  
  3. def main(stdscr):
  4.     # Clear screen
  5.     stdscr.clear()
  6.  
  7.     # This raises ZeroDivisionError when i == 10.
  8.     for i in range(0, 11):
  9.         v = i-10
  10.         stdscr.addstr(i, 0, '10 divided by {} is {}'.format(v, 10/v))
  11.  
  12.     stdscr.refresh()
  13.     stdscr.getkey()
  14.  
  15. wrapper(main)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement