def every(*args, **kwargs):
 interval = total_seconds(timedelta(*args, **kwargs))
 def decorator(func):
  def poll():
   func()
   threading.Timer(interval, poll).start()
  poll()
  return func
 return decorator

def every ( * args , ** kwargs ) : interval = total_seconds ( timedelta ( * args , ** kwargs ) ) def decorator ( func ) : def poll ( ) : func ( ) threading . Timer ( interval , poll ) . start ( ) poll ( ) return func return decorator
method will been called every minutes or seconds .