-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathopenapplication.py
More file actions
42 lines (40 loc) · 1.46 KB
/
openapplication.py
File metadata and controls
42 lines (40 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
from operatingsystem import paths
import os
import speak
import subprocess as sp
from decouple import config
USERNAME=config('USER')
BOTNAME=config('BOTNAME')
def openapp(speech):
if 'code block' in speech:
speak.speakout('opening codeblock')
os.startfile(paths['codeblock'])
elif 'chrome' in speech:
speak.speakout('opening chrome')
os.startfile(paths['chrome'])
elif 'lensstudio' in speech:
speak.speakout('opening lens studio')
os.startfile(paths['lensstudio'])
elif 'explorer' in speech:
speak.speakout('opening file explorer')
os.startfile(paths['explorer'])
elif 'notepad' in speech:
speak.speakout('opening notepad')
os.startfile(paths['notepad'])
elif 'proteus' in speech:
speak.speakout('opening proteus')
os.startfile(paths['proteus'])
elif 'github desktop' in speech:
speak.speakout('opening github desktop')
os.startfile(paths['github desktop'])
elif 'vs code' in speech:
speak.speakout('opening vs code')
os.startfile(paths['vs code'])
elif 'command prompt' in speech:
speak.speakout('opening command prompt')
os.system('start cmd')
elif 'camera' in speech:
speak.speakout('opening camera')
sp.run('start microsoft.windows.camera:', shell=True)
else:
speak.speakout(f"sorry{USERNAME} this application is not in the list")