-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsystem_task.py
129 lines (108 loc) · 4.02 KB
/
system_task.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
import os
import vlc
import speak_module
import random
import subprocess
import datetime
os.system("CLS")
def play_music():
speak_module.speak("Here you go with music")
# music_dir = "C:\Users\LUCKY\Music"
music_dir = "C:\\Users\\Ketan Shah\\Music"
songs = os.listdir(music_dir)
num = random.randint(1,len(songs)-1)
print(songs,len(songs),num)
r = os.startfile(os.path.join(music_dir, songs[num]))
return r
def videos():
speak_module.speak("Here you go with video")
vid_dir = "C:\\Users\\LUCKY\\Videos"
video = os.listdir(vid_dir)
num = random.randint(1,len(video)-1)
print(video,len(video),num)
r = os.startfile(os.path.join(vid_dir, video[num]))
return r
def play_focus():
speak_module.speak("Here you go with video")
power=r"C:\Users\LUCKY\Videos\Ariana Grande - Focus_HD.mp4"
os.startfile(power)
return("playing focus")
def photo():
speak_module.speak("Here you go with photo")
photo_dir = "C:\\Users\\Ketan Shah\\OneDrive\\Pictures"
photos = os.listdir(photo_dir)
num = random.randint(1,len(photos)-1)
print(photos,len(photos),num)
r = os.startfile(os.path.join(photo_dir, photos[num]))
return r
def power_point():
speak_module.speak("here you go with power point")
os.startfile(r"C:\Program Files\Microsoft Office\root\Office16\powerpnt.exe")
return("opening power point presentation")
def close_powerpoint():
speak_module.speak("closing power point")
browserExe = "powerpnt.exe"
os.system("taskkill /f /im "+browserExe)
return ("closed powerpoint")
def word():
speak_module.speak("here you go with word")
os.startfile(r"C:\Program Files\Microsoft Office\root\Office16\Winword.exe")
return ("opening word")
def close_word():
speak_module.speak("closing word")
browserExe = "Winword.exe"
os.system("taskkill /f /im "+browserExe)
return ("closed word")
def excel():
speak_module.speak("here you go with excel")
os.startfile(r"C:\Program Files\Microsoft Office\root\Office16\excel.exe")
return ("opening excel")
def close_excel():
speak_module.speak("closing excel")
browserExe = "excel.exe"
os.system("taskkill /f /im "+browserExe)
return ("closed excel")
#just creats a file and take notes
def note(usertext):
date=datetime.datetime.now()
file_name=str(date).replace(":", "-")+ "-note.txt"
with open(file_name, "w") as f:
f.write(usertext)
p=subprocess.Popen(["notepad.exe",file_name])
return p
def close_notepad():
speak_module.speak("closing notepad")
browserExe = "notepad.exe"
os.system("taskkill /f /im "+browserExe)
return ("closed notepad")
def chrome():
speak_module.speak("here you go with chrome")
os.startfile(r'C:\Program Files\Google\Chrome\Application\chrome.exe')
return ("opening chrome")
def close_chrome():
speak_module.speak("closing chrome")
browserExe = "chrome.exe"
os.system("taskkill /f /im "+browserExe)
return ("closed chrome")
def sublime_text():
speak_module.speak("here you go with sublime text")
os.startfile(r"C:\Program Files\Sublime Text 3\sublime_text.exe")
return ("opening sublime text")
def close_sublime_text():
speak_module.speak("closing sublime text")
browserExe = "sublime_text.exe"
os.system("taskkill /f /im "+browserExe)
return ("closed sublime text")
def vs_code():
speak_module.speak("here you go with vs code")
os.startfile(r"C:\Users\Ketan Shah\AppData\Local\Programs\Microsoft VS Code\Code.exe")
return ("opening vs code")
def close_vs_code():
speak_module.speak("closing vs code")
browserExe = "code.exe"
os.system("taskkill /f /im "+browserExe)
return ("closed vs code")
def shell():
speak_module.speak("here you go with python shell")
os.startfile(r"C:\Users\Ketan Shah\AppData\Local\Programs\Python\Python38\Lib\idlelib\idle.pyw")
return ("opening python shell")