Namaz vakitlerinde masaüstü bildirimler gönderebilecek ve bir yandan da ezan okuyacak bir program yapmayı öğreniyoruz.
Video serisi boyunca kullandığımız siteler:
https://pypi.org/project/win10toast/
https://aladhan.com/prayer-times-api
Kodlar:
import requests from win10toast import ToastNotifier import time isim = "ezan.wav" parametreler = { "city": "İstanbul", "country": "Turkey", "method": 13 } response = requests.get("http://api.aladhan.com/v1/timingsByCity/:date_or_timestamp", params=parametreler) print(response.json()['data']['timings']) saat_ilk = time.strftime("%H:%M:%S") print(saat_ilk) bildirim = ToastNotifier() while True: saat = time.strftime("%H:%M") if saat == response.json()['data']['timings']['Fajr']: bildirim.show_toast( "Sabah Namazı!", "Sabah namazı vakti girdi..", icon_path="softic.ico", duration=60, threaded=True ) elif saat == response.json()['data']['timings']['Dhuhr']: bildirim.show_toast( "Öğle Namazı!", "Öğle namazı vakti girdi..", icon_path="softic.ico", duration=60, threaded=True ) elif saat == response.json()['data']['timings']['Asr']: bildirim.show_toast( "İkindi Namazı!", "İkindi namazı vakti girdi..", icon_path="softic.ico", duration=60, threaded=True ) elif saat == response.json()['data']['timings']['Maghrib']: bildirim.show_toast( "Akşam Namazı!", "Akşam namazı vakti girdi..", icon_path="softic.ico", duration=60, threaded=True ) elif saat == response.json()['data']['timings']['Isha']: bildirim.show_toast( "Yatsı Namazı!", "Yatsı namazı vakti girdi..", icon_path="softic.ico", duration=60, threaded=True )