diff options
author | Biswakalyan Bhuyan <biswa@surgot.in> | 2022-05-08 18:01:56 +0530 |
---|---|---|
committer | Biswakalyan Bhuyan <biswa@surgot.in> | 2022-05-08 18:01:56 +0530 |
commit | bea4f19f1f36a4bf010dacadc10b16c509097e0f (patch) | |
tree | 31e95a1eed42c1922babfb19da5a464d50ce85ae /DataBase/ExtraPro/Alarm.py | |
parent | 591385e00749ffffc72c241594e884d4338e17f4 (diff) | |
download | zara-bea4f19f1f36a4bf010dacadc10b16c509097e0f.tar.gz zara-bea4f19f1f36a4bf010dacadc10b16c509097e0f.tar.bz2 zara-bea4f19f1f36a4bf010dacadc10b16c509097e0f.zip |
Artificial Intelligence
Diffstat (limited to 'DataBase/ExtraPro/Alarm.py')
-rw-r--r-- | DataBase/ExtraPro/Alarm.py | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/DataBase/ExtraPro/Alarm.py b/DataBase/ExtraPro/Alarm.py new file mode 100644 index 0000000..d912df5 --- /dev/null +++ b/DataBase/ExtraPro/Alarm.py @@ -0,0 +1,37 @@ +import os
+from playsound import playsound
+import datetime
+
+extracted_time = open('E:\\Zara\\Data.txt','rt')
+time = extracted_time.read()
+Time = str(time)
+
+delete_time = open("E:\\Zara\\Data.txt",'r+')
+delete_time.truncate(0)
+delete_time.close()
+
+def RingerNow(time):
+
+ time_to_set = str(time)
+ time_now = time_to_set.replace("zara","")
+ time_now = time_now.replace("set alarm for ","")
+ time_now = time_now.replace("set ","")
+ time_now = time_now.replace("alarm ","")
+ time_now = time_now.replace("for ","")
+ time_now = time_now.replace(" and ",":")
+
+ Alarm_Time = str(time_now)
+
+ while True:
+
+ current_time = datetime.datetime.now().strftime("%H:%M")
+
+ if current_time == Alarm_Time:
+ print("Wake Up Sir , It's Time To Work .")
+ playsound("E:\\Zara\\DataBase\\Sounds\\1.mp3")
+
+ elif current_time>Alarm_Time:
+ break
+
+RingerNow(Time)
+
|