Generation

generate functionSun, 04 Dec 2022

Google assistant

def g_assistant(command): if command == "open Reddit Python": url = "https://www.reddit.com/r/Python/" webbrowser.open(url) if command == "what is your name?": speak("My name is Jarvis!") if command == "what is the time?": speak(ctime()) if command == "search": search = takeCommand() url = "https://google.com/search?q=" + search webbrowser.open(url) if command == "location": location = takeCommand() url = "https://google.nl/maps/place/" + location + "/&" webbrowser.open(url) if command == "news": news = webbrowser.open("https://timesofindia.indiatimes.com/home/headlines") print("Listening...") while True: query = takeCommand().lower() g_assistant(query)

Questions about programming?Chat with your personal AI assistant