import subprocess from datetime import datetime, time from utils.sound_utils import play_alarm_sound, SOUNDS now = datetime.now().time() namaz_zohr_time = time(12, 9) < now < time(13, 20) namaz_maghrib_time = time(17, 24) < now < time(18, 45) if not namaz_zohr_time and not namaz_maghrib_time: print("*** PLAYED ALARM SOUND ***") play_alarm_sound(**SOUNDS["notif"]) do_alarm_later = False else: print("*** It's namaz time so we'll play alarm sound later") do_alarm_later = True