1import os
2
3os.system("program_name") # To open any program by their name recognized by windows
4
5# OR
6
7os.startfile("path to application or any file") # Open any program, text or office document
1dir = 'C:\\myprogram.exe'
2
3import os
4os.startfile(dir)
5os.system(dir)
6
7import subprocess
8subprocess.Popen([dir])
9subprocess.call(dir)
1import pyttsx3
2import subprocess
3import os
4import time
5
6
7pyttsx3.speak("Hi user")
8time.sleep(2)
9pyttsx3.speak("you can open any apps in this coming list")
10time.sleep(3)
11print("You can open any app from this list:- ")
12print("NOTEPAD \t GOOGLE\nVirtual Box \t unity \nEXIT ")
13
14while True:
15 # take input
16
17 print("Chat with me which app to open : ", end='')
18 p = input().upper()
19 print(p)
20
21 if ("NOTE" in p) or ("NOTES" in p) or ("NOTEPAD" in p) :
22 pyttsx3.speak("Opening , Notepad")
23 os.system("notepad.exe")
24
25
26
27 elif ("GOOGLE" in p or "CHROME" in p):
28 pyttsx3.speak("opening chrome please wait")
29 time.sleep(3)
30 subprocess.call(['C:/Program Files (x86)/Google/Chrome/Application/chrome'])
31
32
33 elif "UNITY" in p:
34 pyttsx3.speak("Opening unity")
35 subprocess.call(['file path of unity'])
36
37
38 elif ("EXIT" in p) or ("QUIT" in p) or ("CLOSE" in p):
39 print("thanks")
40 time.sleep(1)
41 pyttsx3.speak("Exiting this app thanks for using this app")
42 break
43
44 else:
45 print("Is Invalid,Please Try Again")
46 pyttsx3.speak("its Invalid,Please try again ")
47