User Input Question
Okay, so what if I want to give the user a certain amount of time to give an input, or if something happens in-between that time it overrides it? I'm trying to make a game and I need it to implement this. I am in Python.
Is there any module that can help me with this?
i also use python
you can use import time
and a if statement
and a for loop with range
listname = 0
inputname = ("would you run, fight or hide?" \n)
for x in range(1, 3000):
listname = listname +1
if listname == 3000:
print("time's up! you dident choose something so you lost!")
if inputname == "run":
elif inputname == "fight":
but thats just a example
@MrVoo I'll give an example.
So let's say something random is triggered to happen, but the system is waiting for user input.
I would want the input to cancel and then do the random thing.
It's like trying to run a while loop using input:
You see, the while loop wouldn't run unless the user gave input, and I want to stop that.
(Think of it like timing in a rhythm game sort-of.)