September 5th, 2005, 03:00 PM
Checking for user input.
I'm trying to make a function that will wait for x amount of time, then beep. However, I want the program to break the x amount of time loop if the user presses a key.
My problem is raw_input() waits for the user to return before it will count it. That screws up the while loop and allows it to stay for longer than 30 seconds. I'm new to python, so could someon help me see what I should do. I tried some other functions like sys.stdin and someone reccomended _Getch, but I couldn't figure those out. I think it may be possible to fix it by tweaking the structure, but I can't see how.
September 9th, 2005, 01:45 AM
This is about as far as I am now. The timer seems to work fine, but I can't get it
for i in range(0,times):
till = time.time()
till = till + wait
while till >= time.time() :
till = time.time()sjjjjad
An even simplier explaination might be I just want a timer that stops when A. a user presses a key, or B. after `x' about of time.