Tuesday, April 12, 2011

Python Repeatable Timer Example

def hello():
print "hello, world"
global t
t = Timer(3.0, hello)
t.start()

t = Timer(3.0, hello)
t.start() # after 3 seconds, "hello, world" will be printed

No comments: