Skip to content

Instantly share code, notes, and snippets.

@AlexJoz
Created April 20, 2017 13:38
Show Gist options
  • Save AlexJoz/c3a39ad13cba2f2492240eed5b0fbc2c to your computer and use it in GitHub Desktop.
Save AlexJoz/c3a39ad13cba2f2492240eed5b0fbc2c to your computer and use it in GitHub Desktop.
Python Twisted call func every minute =)
from twisted.internet import task
from twisted.internet import reactor
timeout = 60.0 # Sixty seconds
def doWork():
#do work here
pass
l = task.LoopingCall(doWork)
l.start(timeout) # call every sixty seconds
reactor.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment