473,396 Members | 1,797 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

time and input

I am trying to write a really basic program based on a trivia game. i have two problems. the first, is that i do not know how to assign a variable whose value will increase with time. my second problem is that i need to allow the user to enter an input before time runs out. the problem is that: suppose i successfully start a stopwatch once the question is asked(and assign the stopwatch value to a variable). if i write 'if stopwatchTime < maxTimeAllowed: userAns = input()' the statement will be true, and the program will take an input. but, after i call the input function, the rest of the program suspends until an input is given. i need a way for the program to be simultaneously waiting for an input AND checking to see if the time limit has passed, so that after a certain amount of time, the program will not accept an input from the user.
Jan 15 '12 #1

✓ answered by Jory R Ferrell

See the following:

http://bytes.com/topic/python/answer...-practice-exam

If you need any more help message Bvdet.

2 2372
See the following:

http://bytes.com/topic/python/answer...-practice-exam

If you need any more help message Bvdet.
Jan 15 '12 #2
:P The credit actually goes to Bvdet since she/he is the one who solved it.
Jan 16 '12 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: GitarJake | last post by:
Hello all, I am very new to ASP programming. My experience so far is limited to VBA in Windows based apps like Access, Excel etc. Is ASP event driven like Visual Basic? If so, can ASP...
2
by: Rebecca Smith | last post by:
I'd like to trap an error if a user inputs a bogus time. The input requires a short time format. If the user enters someting like 20:78, Access will catch that but I'd like something of my own....
0
by: Wladimir Mutel | last post by:
Hi, In our legacy asp/web-application, we have date/time-input form in USA style (i.e. mm/dd/yyyy and 12hour-scale time with AM/PM). There is also some validation code on client side, and then...
17
by: Franc Zabkar | last post by:
My D-Link DSL-302G modem/router has a real-time clock whose settings are volatile. To avoid hand keying the date/time via the modem's JS interface, I wonder if there is a way to copy the JS code to...
2
by: namo | last post by:
Hello, I have started a small simulation project to learn C++ and I am faced with the following problem : the user can choose at runtime to simulate protocol P1 or P2. P1 uses packets of type...
1
by: Robert | last post by:
Does the ! work with Date/Time fields. I have a fields that is set as a Date/Time fields - Short Time and I want it to fill in from right to left as Access claims it will. I tried the example that...
1
by: rajsharma1 | last post by:
hi guys, I am making a program in which I have to enter start date and time and stop date and time in format like 01:05:07 15:26:57 i don't know how to get that value from the user in hh:mm:ss...
4
by: Tamer Ibrahim | last post by:
Hi, I have two different text boxes. One is for reading user input date and the other is for reading user input time.I'm using SQL 2005. How can concatenate both of the two fields and send them as...
3
by: Rainy | last post by:
Hello! I'm having some trouble with pyserial package, I'm sending commands and reading responses from a custom pcb, and sometimes I get a proper response, at other times I get nothing, and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.