timeoutbeep.py

# timeoutbeep.py # # Description: Beep 2 seconds after the last key press or beep. # # Date: 17/10/2015 # Written By: G.Evans from unicurses import * stdscr = initscr() halfdelay(20) noecho() curs_set(False) addstr("I will beep 2 seconds after the last key press or beep. Press 'q' to quit") key = 0 while (key != CCHAR('q')) and (key != CCHAR('Q')): key = getch() if key == ERR: beep() endwin()