-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJarvis.py
55 lines (44 loc) · 1.67 KB
/
Jarvis.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import VirtualAssistant
import sys
print("*************** VIRTUAL ASSISTANT *************")
jarvis = VirtualAssistant
def mainMenu():
jarvis.speak("Do you want to Give Command or Select Manually")
ans = input("Do you want to :\n1. Give command\n2. Select manually\n3. Exit\n")
if ans == "1":
jarvis.takeCommand()
elif ans == "3":
jarvis.speak("Exiting.")
print("Exiting...")
sys.exit(0)
elif ans == "2":
while True:
jarvis.speak("Please select any of the commands manually")
an = input("\nPlease select any of the commands manually\n1. Take A Quiz\n2. Get Weather Update\n3. Get Random Facts\n4. Get Time\n5. Search Anything\n6. Hear A Joke\n7. Send Email\n8. Get Nearby Places\n9. Get Book Recommendations\n10. Translate Text\n11.Exit To Main Menu")
if an == "1":
jarvis.takeQuiz()
if an == "2":
jarvis.getWeather()
if an == "3":
jarvis.getFacts()
if an == "4":
jarvis.time()
if an == "5":
jarvis.wiki()
if an == "6":
jarvis.hearJoke()
if an =="7":
jarvis.sendEmail()
if an =="8":
jarvis.getNearbyPlaces()
if an == "9":
jarvis.search_books_by_genre()
if an == "10":
jarvis.translateText()
if an == "11":
mainMenu()
else:
print("Invalid Option. Try Again!")
jarvis.speak("Invalid Option. Try Again")
mainMenu()
mainMenu()