how to repeat something in python ever second code example
Example 1: how to run a function in interval in python
# this makes program sleep in intervals
from time import time, sleep
while True:
sleep(1 - time() % 1) # run every 1 second... you can change that
# thing to run
Example 2: python repet x time
for i in range(50):
print "Some thing"
Example 3: how to repeat code in python until a condition is met
a = 1
b = 1
while (a<10):
print ('Iteration',a)
a = a + 1
b = b + 1
if (b == 4):
break
print ('While loop terminated')