-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOpen.py
41 lines (36 loc) · 1.05 KB
/
Open.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
import os
import keyboard
import pyautogui
import webbrowser
from time import sleep
def OpenExe(Query):
Query = str(Query).lower()
if "visit" in Query:
Nameofweb = Query.replace("visit ","")
Link = f"https://www.{Nameofweb}.com"
webbrowser.open(Link)
return True
elif "launch" in Query:
Nameofweb = Query.replace("launch ","")
Link = f"https://www.{Nameofweb}.com"
webbrowser.open(Link)
return True
elif "open" in Query:
Nameoftheapp = Query.replace("open ","")
pyautogui.press('win')
sleep(1)
keyboard.write(Nameoftheapp)
sleep(1)
keyboard.press('enter')
sleep(0.5)
return True
elif "start" in Query:
Nameoftheapp = Query.replace("open ","")
Nameoftheapp = Query.replace("open ","")
pyautogui.press('win')
sleep(1)
keyboard.write(Nameoftheapp)
sleep(1)
keyboard.press('enter')
sleep(0.5)
return True