22 lines
525 B
Python
22 lines
525 B
Python
|
from schedule import Scheduler
|
||
|
from notify import show_notification
|
||
|
import datetime
|
||
|
import time
|
||
|
|
||
|
|
||
|
def notify_hello():
|
||
|
show_notification("Hello world", "test")
|
||
|
|
||
|
|
||
|
if __name__ == "__main__":
|
||
|
_scheduler = Scheduler()
|
||
|
|
||
|
# _scheduler.every(datetime.timedelta(seconds=3), lambda: print("Hello"))
|
||
|
# _scheduler.at(datetime.timedelta(seconds=5), lambda: print("Should run only once"))
|
||
|
|
||
|
_scheduler.at(datetime.datetime(2019, 7, 1, 12, 4), notify_hello)
|
||
|
|
||
|
while True:
|
||
|
_scheduler.run()
|
||
|
time.sleep(1)
|