无参情况:lc = task.LoopingCall(fun)
如果fun带有参数,可以使用functools.partial传递 (fun2 = partial(fun, param1,[...]) task.LoopingCall(fun2))
from twisted.internet import task,reactor
from functools import partial def test(x):
print 'test',x test1=partial(test,3)
t1=task.LoopingCall(test1)
t1.start(5) #5秒循环调用 reactor.run()