I'm making a little gag program that outputs a bunch of random numbers onto my Ubuntu terminal until the number meet a certain condition, at which point access granted is printed.
However, I'd like to stop the Timer loop once that condition is met, and I don't know how.
Here's the code below:
import random
import threading
def message():
tt = threading.Timer(0.125, message).start()
num = str(random.randint(137849013724,934234850490))
print(num)
if num[3] == "5" and num[6] == "7":
print("access granted")
message()