import sys from time import sleep bts = [ [46, 111, 46], [46, 111, 45], [46, 111, 47], [46, 111, 45], [46, 111, 46], ] q = 0 q_max = len(bts) while True: sys.stdout.write("t" + bytearray(bts[q]).decode('utf-8') + 'r') if q == 2: sleep(0.5) q += 1 if q + 1 > q_max: q = 0 sleep(0.3)