Skip to content
Permalink
Browse files

Switched to new scheduler library for Python

  • Loading branch information...
james-tyner committed Apr 7, 2019
1 parent 853781b commit 9320aaf2e352b81d9b735cc092e408b7f424cbfe
Showing with 23 additions and 0 deletions.
  1. +21 −0 newScheduler.py
  2. +2 −0 weekScheduler.py
@@ -0,0 +1,21 @@
from datetime import datetime
import os
from runEachWeek import getAndSend

from apscheduler.schedulers.blocking import BlockingScheduler


def tick():
getAndSend()
print('Tick! The time is: %s' % datetime.now())


if __name__ == '__main__':
scheduler = BlockingScheduler()
scheduler.add_job(tick, 'cron', day_of_week='wed', hour=11, minute=0)
print('Press Ctrl+{0} to exit'.format('Break' if os.name == 'nt' else 'C'))

try:
scheduler.start()
except (KeyboardInterrupt, SystemExit):
pass
@@ -1,9 +1,11 @@
import schedule
import time
import datetime
from runEachWeek import getAndSend

def job():
getAndSend()
print("Program executed at", datetime.datetime.now())

# UTC = Pacific Date Time + 7
schedule.every().wednesday.at("18:00").do(job)

0 comments on commit 9320aaf

Please sign in to comment.
You can’t perform that action at this time.