Task 1 Python Connect to Os
Screen shot of the screen
Code used
import pyttsx3
import os
pyttsx3.speak("welcome how may i help you")
while True:
print("chat with me as your needs : " , end='')
p = input()
if (("run" in p) or ("execute" in p ) or ("open" in p )) and (("chrome" in p) or ("google" in p)):
os.system("chrome")
elif (("run" in p) or ("execute" in p)) and (("notepad" in p) or ("editor" in p)):
os.system("notepad")
elif("run" in p) and ("player" in p) and ("media" in p):
os.system("wplayer")
elif (("hello" in p) or ("hi" in p) or ("namaste" in p)):
print("Namaste, how are you")
elif (("fine" in p) or ("good" in p)) and ("you" in p):
print("I am fine ,Thanks")
elif ("date" in p) and (("what" in p) or ("show" in p)):
os.system("date")
elif (("calculater" in p) or ("cal" in p)) and ("show" in p):
os.system("cal")
elif ("exit" in p) or ("quit" in p):
print("ok , bbye Thanks, see you later")
else:
print("sorry , I don't support for it")
.
4yGreat work