I am now stepping into python and wrote a little piece of code. I declare a variable as global and then call it inside a function to increment it. However, I get an error "local variable 'iTime' referenced before assignment"
import time, threading
global iTime
def init():
iTime=0
def foo():
iTime+=1
threading.Timer(1, foo).start()
init()
foo()