#!/usr/bin/env python3 from backend.Routine import Routine import sched, time s = sched.scheduler(time.time, time.sleep) routine = Routine() def run_routine(sc): # do some stuff routine.start() #schedule next routine s.enter(600, 1, run_routine, (sc,)) routine.start() s.enter(600, 1, run_routine, (s, )) s.run()