i have sqlite database 4 columns: cycle_no, step, color, duration. run color each step in cycle duration indicated. example, if database contains this: torun = [(1,1,red,2),(1,2,blue,4), (1,3,green,3) red light 2 minutes, blue 4 minutes , green 3 minutes. using wx.timer , process starts on button click.
def onrun(self, event): torun = self.c.execute("select * cycles cycle_no=1").fetchall() print torun row in torun: #something here self.settime() self.lighttimer.start(10000) def settime(self): global timeon = datetime.datetime.now() timeon = + datetime.timedelta(minutes=dur) print timeon def checkruntime(self,event): global timeon, if timeon < datetime.datetime.now(): print 'check time'
i'm not having luck loop. either colors go off @ once or last color lights. thank you.
Comments
Post a Comment