(Q)
| 224 | |
| 225 | |
| 226 | def get_app(Q): |
| 227 | current = Controller() |
| 228 | # master |
| 229 | if Q == "time": |
| 230 | print(datetime.now()) |
| 231 | x = datetime.now() |
| 232 | voice(x) |
| 233 | elif Q == "news": |
| 234 | speak_news() |
| 235 | |
| 236 | elif Q == "open notepad": |
| 237 | subprocess.call(["Notepad.exe"]) |
| 238 | elif Q == "open calculator": |
| 239 | subprocess.call(["calc.exe"]) |
| 240 | elif Q == "open stikynot": |
| 241 | subprocess.call(["StikyNot.exe"]) |
| 242 | elif Q == "open shell": |
| 243 | subprocess.call(["powershell.exe"]) |
| 244 | elif Q == "open paint": |
| 245 | subprocess.call(["mspaint.exe"]) |
| 246 | elif Q == "open cmd": |
| 247 | subprocess.call(["cmd.exe"]) |
| 248 | elif Q == "open discord": |
| 249 | subprocess.call(["discord.exe"]) |
| 250 | elif Q == "open browser": |
| 251 | subprocess.call(["C:\\Program Files\\Internet Explorer\\iexplore.exe"]) |
| 252 | # patch-1 |
| 253 | elif Q == "open youtube": |
| 254 | webbrowser.open("https://www.youtube.com/") # open youtube |
| 255 | elif Q == "open google": |
| 256 | webbrowser.open("https://www.google.com/") # open google |
| 257 | elif Q == "open github": |
| 258 | webbrowser.open("https://github.com/") |
| 259 | elif Q == "search for": |
| 260 | que = Q.lstrip("search for") |
| 261 | answer = ask_gpt3(que) |
| 262 | |
| 263 | elif ( |
| 264 | Q == "email to other" |
| 265 | ): # here you want to change and input your mail and password whenver you implement |
| 266 | try: |
| 267 | speak("What should I say?") |
| 268 | r = sr.Recognizer() |
| 269 | with sr.Microphone() as source: |
| 270 | print("Listening...") |
| 271 | r.pause_threshold = 1 |
| 272 | audio = r.listen(source) |
| 273 | to = "abc@gmail.com" |
| 274 | content = input("Enter content") |
| 275 | sendEmail(to, content) |
| 276 | speak("Email has been sent!") |
| 277 | except Exception as e: |
| 278 | print(e) |
| 279 | speak("Sorry, I can't send the email.") |
| 280 | # ======= |
| 281 | # master |
| 282 | elif Q == "Take screenshot": |
| 283 | snapshot = ImageGrab.grab() |
no test coverage detected