How to break an input function if the user takes much time in typing | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to break an input function if the user takes much time in typing

25th May 2020, 11:27 AM
Emmanuel MECHIE
Emmanuel MECHIE - avatar
2 Answers
+ 3
import time timeout = time.time() + 60*5 # 5 minutes from now while True: test = 0 if test == 5 or time.time() > timeout: break test = test - 1
25th May 2020, 12:32 PM
Ayush Kumar
Ayush Kumar - avatar
+ 1
Maybe if you wrap the input around a timer function, that will do it
25th May 2020, 11:29 AM
✳AsterisK✳
✳AsterisK✳ - avatar