|
1234567891011121314151617181920212223242526272829 |
- from gotify import send_notification_for_tomorrow, send_notification_for_today, send_notif
- import datetime
- import time
-
-
-
- def main():
- while True :
- now = datetime.datetime.now()
- print(type(now.hour))
-
- while now.hour % 9 != 0 :
- print(f"Il est {now.hour}H")
- now = datetime.datetime.now()
- time.sleep(600)
-
- if now.hour == 9 :
- send_notification_for_today()
- elif now.hour == 18 :
- send_notification_for_tomorrow()
- time.sleep(3600)
-
-
- if __name__ == '__main__':
- try :
- main()
- except :
- send_notif("Erreur", "Une erreur s'est produite durant l'execution du script")
- main()
|