You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need help with this code snippet. Below, I'm instantiating a schedule object within a class.
And from within the class I'm running my loop which I hope to run the scheduled job. It seems the "at" method won't accept the job I give it throwing a TypeError. Whereas running it every minute works fine.
In both cases assert statement does not fire. Can someone provide insight?
Thanks,
Dennis
importscheduleimporttimeclassTestSchedule():
def__init__(self):
self.schedule=scheduledefsetup(self):
### WORKS #### self.schedule.every(1).minutes.do(self.job)assertcallable(self.job)
### DOESN'T WORK ###self.schedule.every().day().at("7:54").do(self.job)
defjob(self):
print'Job start at {0}'.format(time.strftime('%H:%M'))
defloop(self):
while1:
self.schedule.run_pending()
print'Sleeping for 10 sec'time.sleep(10)
if__name__=='__main__':
ts=TestSchedule()
ts.setup()
print'Start schedule at {0}'.format(time.strftime('%H:%M'))
ts.loop()
The text was updated successfully, but these errors were encountered:
Hi,
I need help with this code snippet. Below, I'm instantiating a schedule object within a class.
And from within the class I'm running my loop which I hope to run the scheduled job. It seems the "at" method won't accept the job I give it throwing a TypeError. Whereas running it every minute works fine.
In both cases assert statement does not fire. Can someone provide insight?
Thanks,
Dennis
The text was updated successfully, but these errors were encountered: