-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGUI.py
2064 lines (1521 loc) · 57.3 KB
/
GUI.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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#Internet Connectivity Checker
import urllib.request
def connect(host='http://google.com'):
try:
urllib.request.urlopen(host) #Python 3.x
return True
except:
return False
if connect():
print("Connected to Internet")
else:
print("No Internet! Connect your Device with Internet first :( ")
quit()
import pyttsx3
import datetime
import speech_recognition as sr
import wikipedia
import webbrowser
import random
import os
import time
import smtplib
import subprocess
import shutil
import winshell
import ctypes
import requests
import serial
#import win32com.client as wincl
#from bs4 import BeautifulSoup
from ssl import OP_ENABLE_MIDDLEBOX_COMPAT
from tkinter import *
from tkinter import messagebox
from PIL import Image
from time import strftime
from time import sleep
def SelfIntro():
import pyglet
# width of window
width = 1920
# height of window
height = 1080
# caption i.e title of the window
title = "Intro Video"
# creating a window
window = pyglet.window.Window(width, height, title)
# video path
vidPath ="\\Project\\ZOYA GUI\\Videos\\1.mp4"
# creating a media player object
player = pyglet.media.Player()
# creating a source object
source = pyglet.media.StreamingSource()
# load the media from the source
MediaLoad = pyglet.media.load(vidPath)
# add this media in the queue
player.queue(MediaLoad)
# play the video
player.play()
# on draw event
@window.event
def on_draw():
# clea the window
window.clear()
# if player source exist
# and video format exist
if player.source and player.source.video_format:
# get the texture of video and
# make surface to display on the screen
player.get_texture().blit(0, 0)
# key press event
@window.event
def on_key_press(symbol, modifier):
# key "p" get press
if symbol == pyglet.window.key.P:
# pause the video
player.pause()
# printing message
print("Video is paused")
# key "r" get press
if symbol == pyglet.window.key.R:
# resume the video
player.play()
# printing message
print("Video is resumed")
# seek video at time stamp = 4
# and pause the video
#player.seek(4)
#player.pause()
# getting texture of the video
value = player.get_texture()
# printing value of texture
print("Texture : " + str(value))
# run the pyglet application
pyglet.app.run()
quit(1)
#web Browser Settings
chrome_path="C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe"
webbrowser.register('chrome', None,webbrowser.BackgroundBrowser(chrome_path))
#setting up bluetooth connection
#ser = serial.Serial('COM6', 9600 ,bytesize=8 , timeout=1) #change COM Port , baudrate , timeout acc. to your need
#Voice Engine Settings
engine = pyttsx3.init('sapi5')
voices = engine.getProperty('voices')
#print(voices[1].id)
engine.setProperty('voice',voices[1].id)
wifi_name = "CODER_"
#Functions
def exit_():
return exit()
def enable_wifi():
os.system('netsh', 'interface', set , 'interface' +wifi_name+ 'enabled')
def disable_wifi():
os.system("netsh interface set interface "+wifi_name+" disabled")
def sendEmail(to, content):
server = smtplib.SMTP('smtp.gmail.com', 587)
server.ehlo()
server.starttls()
# Enable low security in gmail
server.login('your email id', 'your email passowrd')
server.sendmail('your email id', to, content)
server.close()
def Username():
speak("What should I call you sir")
uname = takeCommand()
speak("Welcome Mister")
speak(uname)
columns = shutil.get_terminal_size().columns
print("Welcome Mr.", uname.center(columns))
def devsupport():
b = webbrowser.get('chrome')
b.open("www.github.com/IamCOD3X")
def sysinfo():
f = open('systeminfo.txt', 'r+')
f.truncate(0) # need '0' when using r+
import subprocess
import sys
# traverse the info
Id = subprocess.check_output(['systeminfo']).decode('utf-8').split('\n')
new = []
# arrange the string into clear info
for item in Id:
new.append(str(item.split("\r")[:-1]))
for i in new:
file_path = 'systeminfo.txt'
sys.stdout = open(file_path,"a")
print(i[2:-2])
sys.stdout.close()
#sleep(2)
#with open('systeminfo.txt','r') as firstfile, open('systeminfo_display.txt','a') as secondfile:
# read content from first file
#for line in firstfile:
# append content to second file
#secondfile.write(line)
#os.system(r"systeminfo.txt")
import subprocess as sp
programName = "notepad.exe"
fileName = "systeminfo.txt"
sp.Popen([programName, fileName])
def sysinfo():
open(r"D\Project\ZOYA GUI\systeminfo.txt")
sysinfo()
#Home Automation
def all_on():
print("Turning All Switchs ON")
ser = serial.Serial('COM6', 9600 ,bytesize=8 , timeout=1) #change COM Port , baudrate , timeout acc. to your need
sleep(0.1)
ser.write(b'Z')
speak("Turning All Switchs ON")
sleep(0.5)
ser.close
def all_off():
print("Turning All Switchs OFF")
ser = serial.Serial('COM6', 9600 ,bytesize=8 , timeout=1) #change COM Port , baudrate , timeout acc. to your need
sleep(0.1)
ser.write(b'z')
speak("Turning All Switchs OFF")
sleep(0.5)
ser.close
def S1_on():
print("Turning ON Switch 1")
ser = serial.Serial('COM6', 9600 ,bytesize=8 , timeout=1) #change COM Port , baudrate , timeout acc. to your need
sleep(0.1)
ser.write(b'A')
speak("Turning ON Switch 1")
sleep(0.5)
ser.close
def S1_off():
print("Turning OFF Switch 1")
ser = serial.Serial('COM6', 9600 ,bytesize=8 , timeout=1) #change COM Port , baudrate , timeout acc. to your need
sleep(0.1)
ser.write(b'a')
speak("Turning OFF Switch 1")
sleep(0.5)
ser.close
def S2_on():
print("Turning ON Switch 2")
ser = serial.Serial('COM6', 9600 ,bytesize=8 , timeout=1) #change COM Port , baudrate , timeout acc. to your need
sleep(0.1)
ser.write(b'B')
speak("Turning ON Switch 2")
sleep(0.5)
ser.close
def S2_off():
print("Turning OFF Switch 2")
ser = serial.Serial('COM6', 9600 ,bytesize=8 , timeout=1) #change COM Port , baudrate , timeout acc. to your need
sleep(0.1)
ser.write(b'b')
speak("Turning OFF Switch 2")
sleep(0.5)
ser.close
def S3_on():
print("Turning ON Switch 3")
ser = serial.Serial('COM6', 9600 ,bytesize=8 , timeout=1) #change COM Port , baudrate , timeout acc. to your need
sleep(0.1)
ser.write(b'C')
speak("Turning ON Switch 3")
sleep(0.5)
ser.close
def S3_off():
print("Turning OFF Switch 3")
ser = serial.Serial('COM6', 9600 ,bytesize=8 , timeout=1) #change COM Port , baudrate , timeout acc. to your need
sleep(0.1)
ser.write(b'c')
speak("Turning OFF Switch 3")
sleep(0.5)
ser.close
def S4_on():
print("Turning ON Switch 4")
ser = serial.Serial('COM6', 9600 ,bytesize=8 , timeout=1) #change COM Port , baudrate , timeout acc. to your need
sleep(0.1)
ser.write(b'D')
speak("Turning ON Switch 4")
sleep(0.5)
ser.close
def S4_off():
print("Turning OFF Switch 4")
ser = serial.Serial('COM6', 9600 ,bytesize=8 , timeout=1) #change COM Port , baudrate , timeout acc. to your need
sleep(0.1)
ser.write(b'd')
speak("Turning OFF Switch 4")
sleep(0.5)
ser.close
#Quick Buttions
def Instagram():
b = webbrowser.get('chrome')
b.open("https://www.instagram.com/")
def Facebook():
b = webbrowser.get('chrome')
b.open("https://www.facebook.com/")
def Twitter():
b = webbrowser.get('chrome')
b.open("https://www.twitter.com/")
def Whatsapp():
b = webbrowser.get('chrome')
b.open("https://web.whatsapp.com/")
def Gmail():
b = webbrowser.get('chrome')
b.open("https://www.gmail.com/")
def Youtube():
b = webbrowser.get('chrome')
b.open("https://www.youtube.com/")
def Amazon():
b = webbrowser.get('chrome')
b.open("https://www.amazon.com/")
def Flipkart():
b = webbrowser.get('chrome')
b.open("https://www.flipkart.com/")
#█ █▀▄▀█ █▀█ █▀▀ █░█ █▄░█ █▀▀ ▀█▀ █ █▀█ █▄░█ █▀
#█ █░▀░█ █▀▀ █▀░ █▄█ █░▀█ █▄▄ ░█░ █ █▄█ █░▀█ ▄█
def speak(audio):
engine.say(audio)
engine.runAndWait()
print("Initialization Sequence Completed")
speak("Initialization Sequence Completed")
sleep(1)
print("Welcome to ZOYA AI Program")
speak("Welcome to ZOYA AI Program")
def wishMe():
hour = int(datetime.datetime.now().hour)
if hour>=0 and hour<12:
speak("Good Morning Sir!")
print("Good Morning Sir!")
elif hour>=12 and hour<18:
speak("Good Afternoon Sir!")
print("Good Afternoon Sir!")
else:
speak("Good Evening Sir!")
print("Good Evening Sir!")
print("Hi I'm Zoya. Please tell me, How may I help you")
speak("Hi I'm Zoya. Please tell me, How may I help you")
def Features():
# open method used to open different extension image file
im = Image.open(r"\Project\ZOYA GUI\Images\AIFeatures.jpg")
# This method will show image in any image viewer
im.show()
def RPass():
print("Opening Password Generator")
speak("Opening Password Generator")
from subprocess import call
call(["python", "\Project\ZOYA GUI\Modules\RP.py"])
def QOTD():
print("Quote of the day is")
speak("Quote of the day is")
from subprocess import call
call(["python", "\Project\ZOYA GUI\Modules\QOTD.py"])
def Weather():
print("Opening Weather Utility")
speak("Opening Weather Utility")
from subprocess import call
call(["python", "\Project\ZOYA GUI\Modules\Weather.py"])
def Device_Security():
print("Opening Port Scanner")
speak("Opening Port Scanner")
from subprocess import call
call(["python", "\Project\ZOYA GUI\Modules\OP.py"])
def Resources():
import webbrowser
webbrowser.open("https://doctorsforyou.org/")
def AirQuality():
print("Opening Air Quality Checker")
speak("Opening Air Quality Checker")
from subprocess import call
call(["python", "\Project\ZOYA GUI\Modules\AQ.py"])
def HomeAutomation():
print("Opening HomeAutomation Utility")
speak("Opening HomeAutomation Utility")
from subprocess import call
call(["python", "\Project\ZOYA GUI\Modules\HomeAutomation.py"])
def takeCommand():
r = sr.Recognizer()
with sr.Microphone() as source:
print("Listening to you...")
speak("Listening to you...")
r.pause_threshold = 1
audio = r.listen(source)
try:
print("Recognizing...")
query = r.recognize_google(audio, language='en-IN' or 'hi-IN')
print("You said: {}".format(query))
except Exception as e:
#print(e)
print("Try again please.....")
speak("Try again please.....")
return "www.google.com"
query = query.lower()
return query
#█▀ ▀█▀ ▄▀█ █▀█ ▀█▀
#▄█ ░█░ █▀█ █▀▄ ░█░
def info():
messagebox.showinfo("About","I'm your AI Assistant. Developed By Sourabh. Coded in Python.")
def Start():
wishMe()
while True:
query = takeCommand()
assname =("ZOYA")
if 'wikipedia' in query:
sr.Microphone(device_index=1)
r=sr.Recognizer()
r.energy_threshold=5000
with sr.Microphone() as source:
audio=r.listen(source)
try:
query = query.replace("on wikipedia","")
url='https://www.google.co.in/search?q='
search_url=url+query
b = webbrowser.get('chrome')
b.open(search_url)
except:
print("Can't recognize, Please Try again")
print('Searching Wikipedia...')
speak('Searching Wikipedia...')
query = query.replace("wikipedia","")
results = wikipedia.summary(query, sentences=3)
print("According to Wikipedia")
speak("According to Wikipedia")
print(results)
speak(results)
sleep(5)
elif 'show me some memories' in query or "do i have memories" in query:
print("Showing Memories form PC")
speak("Showing Memories form PC")
Memories = '\\Project\\ZOYA GUI\\Memories'
Photos = random.choice(os.listdir(Memories))
print(Photos)
os.startfile(os.path.join(Memories, Photos))
#import PIL
#import Image
#filelist = ['test.tif','test2.tif']
#for imagefile in filelist:
#im=Image.open(imagefile)
#box=(50, 50, 200, 200)
#im_crop=im.crop(box)
#im_crop.show()
sleep(5)
elif "what's your name" in query or "what is your name" in query:
print("My friends call me", assname)
speak("My friends call me")
speak(assname)
sleep(5)
elif 'news' in query:
speak("In which language would you like to listen todays top news")
sr.Microphone(device_index=1)
r=sr.Recognizer()
r.energy_threshold=5000
with sr.Microphone() as source:
print("Listening...!")
audio=r.listen(source)
query=r.recognize_google(audio)
try:
if "English" in query:
try:
query="todays top news in english"
url='https://www.google.co.in/search?q='
search_url=url+query
b = webbrowser.get('chrome')
b.open(search_url)
except:
print("Can't recognize, Please Try again")
elif "Hindi" in query:
try:
query="todays top news in hindi"
url='https://www.google.co.in/search?q='
search_url=url+query
b = webbrowser.get('chrome')
b.open(search_url)
except:
print("Can't recognize, Please Try again")
else:
try:
query
query1="todays top news in "
url='https://www.google.co.in/search?q='
search_url=url+query1+query
b = webbrowser.get('chrome')
b.open(search_url)
except:
print("Can't recognize, Please Try again")
except:
print("Can't recognize, Please Try again")
sleep(5)
elif ' show system information' in query:
print("Please wait. Collecting System Information")
speak("Please wait. Collecting System Information")
sysinfo()
elif 'generate random password' in query:
import random
import string
lower = string.ascii_lowercase
upper = string.ascii_uppercase
digits = string.digits
symbol = "@"
all = lower + upper + digits + symbol
length = 10
password = "".join(random.sample(all, length))
print("Random Password is:")
print(password)
sleep(5)
elif "open screen recorder" in query:
import pyautogui
import cv2
import numpy as np
resolution = (1920, 1080)
codec = cv2.VideoWriter_fourcc(*"XVID")
filename="ScreenRecording.avi"
fps=30.0
out=cv2.VideoWriter(filename , codec , fps ,resolution)
cv2.namedWindow("Live", cv2.WINDOW_NORMAL)
cv2.resizeWindow("Live",480,270)
while True:
img = pyautogui.screenshot()
frame=np.array(img)
frame=cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
out.write(frame)
cv2.imshow("Live", frame)
if cv2.waitKey(1)==ord("q"):
break
out.release()
cv2.destroyAllWindows()
sleep(5)
elif 'search' in query:
try:
query = query.replace("search","")
print("You said: {}".format(query))
url='https://www.google.co.in/search?q='
search_url=url+query
b = webbrowser.get('chrome')
b.open(search_url)
except:
print("Can't recognize, Please Try again")
sleep(5)
elif 'enable wifi' in query or 'turn-on Wi-Fi' in query:
print("Enaabling WI-Fi")
speak("Enaabling WI-Fi")
os.popen(enable_wifi)
sleep(5)
elif 'disable wifi' in query or 'turn-off Wi-Fi' in query:
print("Disabling WI-Fi")
speak("Disabling WI-Fi")
os.popen(disable_wifi)
sleep(5)
elif "covid support" in query:
print('Showing Information')
speak("Showing Information")
b = webbrowser.get('chrome')
b.open("https://www.covid19india.org/")
b.openr(r'file://Project\ZOYA GUI\Files\CovidResources.pdf')
b.open("https://docs.google.com/spreadsheets/d/1rd8vtTNOkXZ8lxsNW8cYQUBZhtkIIgledPR-md1Oprk/edit#gid=0")
sleep(5)
elif "dinesh saran" in query:
b = webbrowser.get('chrome')
b.open("https://www.facebook.com/PtNrsGovtCollageRohtak/photos/pcb.4513091765474224/4513091688807565/")
elif "dinesh saharan" in query:
b = webbrowser.get('chrome')
b.open("https://www.facebook.com/PtNrsGovtCollageRohtak/photos/pcb.4513091765474224/4513091688807565/")
elif 'youtube' in query:
b = webbrowser.get('chrome')
b.open("youtube.com")
sleep(5)
elif 'twitter' in query:
b = webbrowser.get('chrome')
b.open("twitter.com")
sleep(5)
elif 'google translate' in query:
b = webbrowser.get('chrome')
b.open("translate.google.com")
sleep(5)
elif 'flipkart' in query:
b = webbrowser.get('chrome')
b.open("flipkart.com")
sleep(5)
elif 'pc shop' in query:
b = webbrowser.get('chrome')
b.open("pcshop.in")
sleep(5)
elif 'map' in query:
b = webbrowser.get('chrome')
b.open("google.com/maps")
sleep(5)
elif 'classroom' in query:
b = webbrowser.get('chrome')
b.open("https://classroom.google.com/u/1/h")
sleep(5)
elif 'meet' in query:
b = webbrowser.get('chrome')
b.open("meet.google.com/")
sleep(5)
elif 'discord' in query:
b = webbrowser.get('chrome')
b.open("https://discord.com/")
sleep(5)
elif 'google' in query:
b = webbrowser.get('chrome')
b.open("google.com")
sleep(5)
elif 'instagram' in query:
b = webbrowser.get('chrome')
b.open("instagram.com")
sleep(5)
elif 'search' in query :
query = query.replace("search", "")
b = webbrowser.get('chrome')
b.open(query)
sleep(5)
elif 'gmail' in query:
b = webbrowser.get('chrome')
b.open("gmail.com")
sleep(5)
elif 'github' in query:
b = webbrowser.get('chrome')
b.open("github.com")
sleep(5)
elif 'facebook' in query:
b = webbrowser.get('chrome')
b.open("facebook.com")
sleep(5)
elif 'stackoverflow' in query:
b = webbrowser.get('chrome')
b.open("stackoverflow.com")
sleep(5)
elif 'whatsapp' in query:
b = webbrowser.get('chrome')
b.open("web.whatsapp.com")
sleep(5)
elif 'yt music' in query:
b = webbrowser.get('chrome')
b.open("music.youtube.com")
sleep(5)
elif 'amazon' in query:
b = webbrowser.get('chrome')
b.open("amazon.in")
sleep(5)
elif 'time' in query:
strTime = datetime.datetime.now().strftime("%H:%M:%S")
speak(f"Sir , the time is {strTime}")
sleep(5)
elif 'code' in query:
Path = "C:\\Users\\didio\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe"
os.startfile(Path)
sleep(5)
elif 'chrome' in query:
Path = 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe'
os.startfile(Path)
sleep(5)
elif 'virtual dj' in query:
Path = 'C:\\Program Files\\VirtualDJ\\virtualdj.exe'
os.startfile(Path)
sleep(5)
elif 'torrent' in query:
Path = "C:\\Users\\didio\\AppData\\Roaming\\uTorrent\\uTorrent.exe"
os.startfile(Path)
sleep(5)
elif 'edge' in query:
Path = "C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe"
os.startfile(Path)
sleep(5)
elif 'explorer' in query:
Path = "C:\\Windows\\explorer.exe"
os.startfile(Path)
sleep(5)
elif 'games folder' in query:
Path = "D:\\Games"
os.startfile(Path)
sleep(5)
elif 'downloads folder' in query:
Path = "C:\\Users\\didio\\Downloads"
os.startfile(Path)
sleep(5)
elif 'music folder' in query:
Path = "C:\\Users\\didio\\Music"
os.startfile(Path)
sleep(5)
elif 'videos folder' in query:
Path = "C:\\Users\\didio\\Videos"
os.startfile(Path)
sleep(5)
elif 'notepad plus' in query:
Path = "C:\\Program Files\\Notepad++\\notepad++.exe"
os.startfile(Path)
sleep(5)
elif 'calculator' in query:
subprocess.Popen('C:\\Windows\\System32\\calc.exe')
sleep(5)
elif 'camera' in query:
subprocess.run('start microsoft.windows.camera:', shell=True)
sleep(5)
elif 'notepad' in query:
subprocess.Popen('C:\\Windows\\System32\\notepad.exe')
sleep(5)
elif 'wordpad' in query:
subprocess.Popen('C:\\Windows\\System32\\write.exe')
sleep(5)
elif 'task manager' in query:
subprocess.Popen('C:\\Windows\\System32\\taskmgr.exe')
sleep(5)
elif 'command' in query:
subprocess.Popen('C:\\Windows\\System32\\cmd.exe')
sleep(5)
elif 'ms info' in query:
subprocess.Popen('C:\\Windows\\System32\\msinfo32.exe')
sleep(5)
elif 'dialer' in query:
subprocess.Popen('C:\\Windows\\System32\\dialer.exe')
sleep(5)
elif 'snipping tool' in query:
subprocess.Popen('C:\\Windows\\System32\\SnippingTool.exe')
sleep(5)
elif 'resource manager' in query:
subprocess.Popen('C:\\Windows\\System32\\resmon.exe')
sleep(5)
elif 'performance manager' in query:
subprocess.Popen('C:\\Windows\\System32\\perfmon.exe')
sleep(5)
elif 'ms config' in query:
subprocess.Popen('C:\\Windows\\System32\\msconfig.exe')
sleep(5)
elif 'dx diag' in query:
subprocess.Popen('C:\\Windows\\System32\\dxdiag.exe')
sleep(5)
elif 'device properties' in query:
subprocess.Popen('C:\\Windows\\System32\\DeviceProperties.exe')
sleep(5)
elif 'game panel' in query:
subprocess.Popen('C:\\Windows\\System32\\GamePanel.exe')
sleep(5)
elif 'paint' in query:
subprocess.Popen('C:\\Windows\\System32\\mspaint.exe')
sleep(5)
elif "check internet speed" in query:
b = webbrowser.get('chrome')
b.open("https//www.fast.com")
elif "local disk a" in query:
try:
os.startfile("A:")
print("Opening Disk")
speak("Opening Disk")
except Exception as e:
not os.path.exists("A:")
print("Disk Not Found")
speak("Disk Not Found")
sleep(5)
elif "local disk b" in query:
try:
os.startfile("B:")
print("Opening Disk")
speak("Opening Disk")
except Exception as e:
not os.path.exists("B:")
print("Disk Not Found")
speak("Disk Not Found")
sleep(5)
elif "local disk c" in query:
try:
os.startfile("C:")
print("Opening Disk")
speak("Opening Disk")
except Exception as e: