Timer events

Paul McNett p at ulmcnett.com
Mon May 17 19:36:23 EDT 2004


Laughlin, Joseph V writes:

> If I want a function to be called every second, how would I
> do this? Would I use timer events?

The simplest but least flexible method is real easy:

import time

def myfunc():
        print "myfunc", time.ctime()

while True:
        myfunc()
        time.sleep(1)


-- 
Paul





More information about the Python-list mailing list