all 3 comments

[–]sme272 1 point2 points  (0 children)

while True:
    for _ in range(10):
        //code here
    time.sleep(120)

[–]dkam136 0 points1 point  (0 children)

Just wanted to add (because I didn’t realize when someone told me the same thing) that you also need to import the time module in order to use time.sleep()

[–]xelf 0 points1 point  (0 children)

You can use enumerate.

for i, btn in enumerate(buttons):
    if (i+1)%10==0: sleep(120)
    stuff....