I want to take a timed input. If the user doesn't give the input under a limited amount of seconds, the program moves on. So, I learned about inputimeout() but even when I am giving the input within the time limit, it just waits for the timeout. (Also I am not able to solve the problem from other similar questions and that is why I decided to mention this problem)
from inputimeout import inputimeout, TimeoutOccurred
try:
something = inputimeout(prompt = 'Enter: ', timeout=5)
except TimeoutOccurred:
print('Time Over')
Output for the above code:
Enter: e
Time Over
Process finished with exit code 0
Even if I give the input within the time limit, it shows Time Over. Can anyone please help me out?