Artificial Intelligence(Part-4)

Artificial Intelligence(Part-4) 
A Final Chatbot With The Help Of Part 1,2,3 The Final Result Of The -
Text to speech,Folder Opening,Website Opening,Greetings

Code Is Here:--

import pyttsx3
import webbrowser as wb
import os
engine=pyttsx3.init()
engine.say("Hi Sir I am Bob")
engine.runAndWait()
def speek_text_cms(cmd):
    engine.say(cmd)
    engine.runAndWait()

print("Hi Sir I am Bob")
while True:
    print("Say Sir")
    command = input()
    while True:
        if "hi" in command:
            speek_text_cms("Hello Sir")
            print("Hello Sir")
            break        elif "good morning" in command:
            print(" A Very Good Morning Sir")
            speek_text_cms(" A Very Good Morning Sir")
            break        elif "bye" in command:
            print("Bye-Bye Sir")
            speek_text_cms("Bye-Bye Sir")
            exit()
        elif "youtube" in command:
            print("Opening Sir")
            speek_text_cms("Opening Sir")
            wb.open("https://www.youtube.com/")
            break        elif "download" in command:
            print("opening sir")
            speek_text_cms("Opening Sir")
            os.system('explorer C:\\Users\\Satyam Rana\\Download')
            break        else:
            print("Not Understand Sir")
            speek_text_cms("Not Understand Sir")
            break


THANKS FOR WATCHING 

No comments

Powered by Blogger.