Code: Select all
import time;
def vars():
global toggleA
def update():
toggleA = 1
diagnostics.watch(toggleA)
diagnostics.watch('OK')
if starting:
freeTrack.update += update
diagnostics.watch(time.clock())
toggleA = 23
diagnostics.watch(toggleA)
If it is run, toggleA toggles between 1 and 23, even though the starting condition is run only once (which is evident from the clock function). What is going on here?