Beispiel #1
0
            speak(pyjokes.get_joke())

        elif 'location' in query:
            speak('What is the location?')
            location = takecommand()
            url = 'https://google.nl/maps/place/' + location + '/&'
            webbrowser.open(url)
            speak('Here is the location ' + location)

        elif "calculate" in query:  
              
            app_id = "QWY58H-6AJQ4U8LKT" 
            client = wolframalpha.Client(app_id) 
            indx = query.lower().split().index('calculate')  
            query = query.split()[indx + 1:]  
            res = client.query(' '.join(query))  
            answer = next(res.results).text 
            print("The answer is " + answer)  
            speak("The answer is " + answer)

        elif "add" in query:  
              
            app_id = "QWY58H-6AJQ4U8LKT" 
            client = wolframalpha.Client(app_id) 
            indx = query.lower().split().index('add')  
            query = query.split()[indx + 1:]  
            res = client.query(' '.join(query))  
            answer = next(res.results).text 
            print("The answer is " + answer)  
            speak("The answer is " + answer)
Beispiel #2
0
        print "time - Current Time."
        print "dictionary - Search for your term meanings."
        print "weather - Current Weather Details."
        print "selfie - Opens Camera To Click Photos."
        print "rail - Enter ARIS System to get information regarding Indian Railways."
        print "stock - Get Information Of Stock Market."
        print "imdb - Search For any Movie, Actor, TV Show in IMDb."
        print "result - Get B.tech results Notification on your phone."
        print "status - Check Status of the Amelia's Working. \n"

    elif message == "":
        print "*****************Please Enter Input*****************"

######################### Normal Response From AIML And if Not found WIKI and Google######################
    else:
        text2speak = kernel.respond(message)
        print "Amelia : {0}".format(text2speak)
        splash_pix = QtGui.QPixmap('robo.jpg')
        splash = QtGui.QSplashScreen(splash_pix)
        splash.setMask(splash_pix.mask())
        splash.show()
        voices = engine.getProperty('voices')
        engine.setProperty('voice', voices[1].id)
        engine.say(text2speak)
        engine.runAndWait()
        splash.hide()

        if kernel.respond(message) == "Lemme Think":
            res = client.query(message)
            print(next(res.results).text)