-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenAW.py
57 lines (47 loc) · 1.9 KB
/
openAW.py
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import os
import subprocess
import webbrowser
def openApp(app:str):
if app.__contains__('calculadora'):
subprocess.Popen('C:\\Windows\\System32\\calc.exe')
return "Calculadora"
elif app.__contains__("cmd"):
subprocess.Popen('C:\\Windows\\System32\\cmd.exe')
return "Simbolo del sistema"
elif app.__contains__("Simbolo del sistema"):
subprocess.Popen('C:\\Windows\\System32\\cmd.exe')
return "Simbolo del sistema"
elif app.__contains__("word"):
subprocess.Popen('C:\\Windows\\System32\\write.exe')
return "Word"
elif app.__contains__("wordpad"):
subprocess.Popen('C:\\Windows\\System32\\write.exe')
return "Word"
elif app.__contains__("paint"):
subprocess.Popen('C:\\Windows\\System32\\mspaint.exe')
return "Paint"
#######################---APP-WEB---#######################
elif app.__contains__("discord"):
if os.path.isfile("C:\\Users\\" + os.getlogin() + "\\AppData\\Local\\Discord\\app-1.0.9004\\Discord.exe"):
subprocess.Popen(str("C:\\Users\\" + os.getlogin() + "\\AppData\\Local\\Discord\\app-1.0.9004\\Discord.exe"))
return "Discord"
else:
webbrowser.open("https://discord.com")
return "Discord"
#########################---WEB---#########################
elif app.__contains__('facebook'):
webbrowser.open("https://www.facebook.com")
return "Faebook"
elif app.__contains__("github"):
webbrowser.open("https://github.com")
return "GitHub"
elif app.__contains__("youtube"):
webbrowser.open("https://youtube.com")
return "Youtube"
elif app.__contains__("whatsapp"):
webbrowser.open("https://web.whatsapp.com")
return "Whatsapp"
else:
return "NOT APP"
if __name__ == '__main__':
print(openApp(""))