Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 20 additions & 14 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import webbrowser
import os
import smtplib
import datetime
import time

print("Initializing Jarvis")
MASTER = "Aman"
Expand All @@ -18,20 +20,24 @@ def speak(text):
engine.runAndWait()

#This funtion will wish you as per the current time
def wishMe():
hour = int(datetime.datetime.now().hour)
print(hour)

if hour>=0 and hour <12:
speak("good morning" + MASTER)

elif hour>=12 and hour<18:
speak("good afternoon" + MASTER)

else:
speak("good Evening" + MASTER)

speak("i am your assistant. How may I help you?")
hour = datetime.datetime.now().strftime("%I")
am_or_pm = datetime.datetime.now().strftime("%p")
morning = False
afternoon = False
evening = False
night = False
while True:
if int(hour) >= 5 and am_or_pm == "AM" and morning == False:
pyttsx3.speak("Good morning sir")
morning = True
elif int(hour) == 12 and am_or_pm == "PM" and afternoon == False:
pyttsx3.speak("Good afternoon sir")
afternoon = True
elif int(hour) >= 4 and am_or_pm == "PM" and evening == False:
pyttsx3.speak("Good evening sir")
evening = True
time.sleep(10)

def sendEmail(to, content):
server = smtplib.SMTP('smtp.gmail.com', 587)
Expand Down Expand Up @@ -114,4 +120,4 @@ def main():
print(e)


main()
main()