I want to execute a function repeatedly every 5 seconds and at the same time take input from the user and based on the input stop the execution? Ex:
def printit():
t=threading.Timer(3.0,printit)
t.start()
n=str(input())
if(n=='rajesh'):
t.cancel()
else:
#I want to continue the execution here