Skip to content

Commit 9fc8280

Browse files
authored
Updated and fixed server based errors
1 parent fabcedc commit 9fc8280

File tree

1 file changed

+1
-57
lines changed

1 file changed

+1
-57
lines changed

jarvis.py

Lines changed: 1 addition & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,13 @@
66
import wikipedia
77
import webbrowser
88
import random
9-
import smtplib
109

1110

1211

1312
engine = pyttsx3.init('sapi5')
1413
voices=engine.getProperty('voices')
1514
engine.setProperty('voices', voices[0].id)
1615

17-
email_dict={
18-
"me":"sahasubhadip54@gmail.com",
19-
"baba":"sasti.saha75@gmail.com",
20-
"didi":"sahasnehafkk@gmail.com"}
21-
2216

2317

2418
list_of_jokes = ["The three most well known languages in India are English, Hindi, and... JavaScript","Interviewer... Where were you born?Me in India... Interviewer:.. oh, which part?... Me: What ‘which part’ ..? Whole body was born in India","how many Indians does it take to fix a lightbulb?Two. One to do the task and other to explain how lightbulbs were actually invented in ancient India","What do you call bread from India? It's Naan of your business","Britain: Drive on the left side... Europe and America: Drive on the right side...India: lol what's a 'traffic law'?"]
@@ -67,14 +61,6 @@ def takeCommand(): #takes microphone inout and returns output
6761
return "None" #None string will be returned
6862
return query
6963

70-
def sendEmail(to, econtent): #sending email
71-
server = smtplib.SMTP('smtp.gmail.com', 587)
72-
server.ehlo()
73-
server.starttls()
74-
server.login('subhadipsudi@gmail.com', 'Sudi@1234')
75-
server.sendmail('subhadipsudi@gmail.com', to, econtent)
76-
server.close()
77-
7864
if __name__ == "__main__":
7965
wishMe()
8066
speak("How May I Help You Sir ?")
@@ -119,54 +105,12 @@ def sendEmail(to, econtent): #sending email
119105
elif 'download youtube videos' in query:
120106
speak("Here We Go")
121107
webbrowser.open("en.onlinevideoconverter.pro")
122-
elif 'play music' in query:
123-
music_dir = 'C:\\Users\\sahas\\OneDrive\\Desktop\\Subhadip\\Media\\Fav one'
124-
songs = os.listdir(music_dir)
125-
a=len(songs)-1
126-
ran_num= random.randint(0,a)
127-
os.startfile(os.path.join(music_dir, songs[ran_num]))
128108
elif 'the time' in query:
129109
strTime = datetime.datetime.now().strftime("%H:%M:%S")
130110
speak(strTime)
131111
elif 'the date' in query:
132112
today=datetime.date.today()
133113
speak(today)
134-
elif 'open downloads' in query:
135-
downloadPath='C:\\Users\\sahas\\Downloads'
136-
os.startfile(downloadPath)
137-
elif 'my important documents' in query:
138-
downloadPath='F:\\Media'
139-
os.startfile(downloadPath)
140-
elif 'my media' in query:
141-
downloadPath='F:\\Docs'
142-
os.startfile(downloadPath)
143-
elif 'code' in query:
144-
ApplicationPath="C:\\Users\\sahas\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe"
145-
os.startfile(ApplicationPath)
146-
elif 'filmora' in query:
147-
ApplicationPath="C:\\Program Files\\Wondershare\\Filmora9\\Wondershare Filmora9.exe"
148-
os.startfile(ApplicationPath)
149-
elif 'chrome' in query:
150-
ApplicationPath="C:\\Program Files\\Google\Chrome\\Application\\chrome.exe"
151-
os.startfile(ApplicationPath)
152-
elif 'email' in query:
153-
try:
154-
if 'me' in query:
155-
to = email_dict.get("me")
156-
elif 'baba' in query:
157-
to = email_dict.get("baba")
158-
elif 'didi' in query:
159-
to = email_dict.get("didi")
160-
else:
161-
to = input("Enter New Email: ")
162-
163-
speak("What should I say ?")
164-
econtent=takeCommand()
165-
sendEmail(to, econtent)
166-
speak("Email has been sent!")
167-
except Exception as e:
168-
print("Sorry Sir, I can't send the email")
169-
speak("Sorry Sir, I can't send the email")
170114
elif query == 'jarvis':
171115
speak("At Your Service Sir, How can I help you")
172116
elif 'joke' in query:
@@ -189,4 +133,4 @@ def sendEmail(to, econtent): #sending email
189133
speak("All Tasks has been cleared, Sir !")
190134
elif 'jarvis quit' in query or 'exit' in query or 'close' in query:
191135
speak("Thanks you for using Jarvis Sir")
192-
exit()
136+
exit()

0 commit comments

Comments
 (0)