You are on page 1of 1

import os

import pyttsx3 as p
#speak() converts text to speech
p.speak("Welcome to my chatbot")
#loops until user specify to quit
while True:
p.speak("what can I do for you ? ")
userinput = input()
#opens Microsoft Edge
if ("run" in userinput and ("Microsoft Edge" in userinput)) or
("execute" in userinput and ("Microsoft Edge" in userinput)) or ("open" in
userinput and ("Microsoft Edge" in userinput)) or ("launch" in userinput and
("Microsoft Edge" in userinput)) :
p.speak("Microsoft Edge will be launched soon")
os.system("msedge")
#opens Powerpoint
elif ("run" in userinput and ("Powerpoint" in userinput)) or
("execute" in userinput and ("Powerpoint" in userinput)) or ("open" in
userinput and ("Powerpoint" in userinput)) or ("launch" in userinput and
("Powerpoint" in userinput)) :
p.speak("Paint will be opened soon")
os.system("POWERPNT")
#It stops the execution
elif ("exit" in userinput) or ("quit" in userinput):
p.speak("Thanks for opting me . Share your smiles")
break
#If user inputs anything wrong, it shows don't support
else:
print("don't support")

You might also like