-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWebServer.py
More file actions
64 lines (44 loc) · 1.65 KB
/
WebServer.py
File metadata and controls
64 lines (44 loc) · 1.65 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
def WS():
import speech_recognition as sr
import os
import pyttsx3 as py
py.speak("Enter your remote IP Address.")
ip = input("Enter your IP Address: ")
print("\t\t\t Menu Card \n")
py.speak("Here my Webserver menu is displayed.")
py.speak("with the help of thid code you can install apache webserver.")
print("Install webserver")
py.speak("and also you can start the webservices.")
print("Start services")
py.speak("you can do autometically everything.")
print("for everthing autometically")
def ins():
os.system("ssh root@{} yum install httpd".format(ip))
def st():
os.system("ssh root@{} systemctl start httpd".format(ip))
def tt():
os.system("ssh root@{} yum install httpd ".format(ip))
os.system("ssh root@{} systemctl start httpd".format(ip))
os.system("ssh root@{} systemctl status httpd".format(ip))
print("\n\n\t\t\t Web Server successfully configure\n\n")
while True:
py.speak("Tell me. What i do for you ?")
print("what i do for you ? : ")
r = sr.Recognizer()
z = sr.Recognizer()
with sr.Microphone() as s:
py.speak("Start saying...")
print("start saying ....")
audio = r.listen(s)
py.speak("i got it...")
print(" i got it ...")
ipp = z.recognize_google(audio)
if ("install" in ipp) and ("webserver" in ipp):
ins()
elif ("start" in ipp) and ("service" in ipp):
st()
elif ("create" in ipp) and ("everything" in ipp):
tt()
else:
exit()
WS()