I have a python script that updates a variable every second, using the code:
import threading
m = 0
def printthis():
threading.Timer(0.5,printthis).start()
def f1():
global m
m = m + 1
return
f1()
printthis()
I would like the variable m to be updated on the idle shell every second. I dont want the program to just print 1, 2, 3, 4... I would like it to print 1, then refresh the shell to show what the variable has changed to.