-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
216 lines (210 loc) · 8.63 KB
/
main.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
import os
from time import sleep
password1 = input('Please enter your password : ')
verify = 0
kicker = 0
def clear():
_ = os.system('cls')
while verify == 0:
# password to be taken from school database
password2 = input("Password from database : ")
if password1 == password2:
# name to be taken from school database
name = input("Please enter your name: ")
print("Welcome " + name + ", you have been registered")
verify = 1
level = len(password1)
if level == 8:
user = "S"
elif level == 12:
user = "T"
elif level == 16:
user = "A"
else:
print("The passwords do not match. Please try again.")
kicker = kicker + 1
if kicker == 3:
print("You have failed too many times. ")
quit()
loop = 0
while loop == 0:
if user == "S":
function = int(input("What would you like to do? 1) Check Internet Access 2) Go outside 3) Look at timetable "
"4) Get menu for today 5) Exit "))
if function == 1:
print("Checking internet access level")
print("Student Internet Access")
sleep(10)
clear()
elif function == 2:
print("Start pollution sensors")
pollution = int(input("Please input outside pollution level ppm: "))
if 0 <= pollution <= 350:
print("The outside has a pollution level of " + str(pollution) + " ppm. It is very safe to go out. ")
sleep(20)
clear()
elif 350 <= pollution <= 1000:
print("The outside has a pollution level of " + str(pollution) + " ppm. It is safe to go out. ")
sleep(20)
clear()
elif 1000 <= pollution <= 2000:
print(
"The outside has a pollution level of " + str(pollution) + "ppm. It is advised to not stay out for "
"too long. ")
sleep(20)
clear()
elif 2000 <= pollution <= 5000:
print("The outside has a pollution level of " + str(pollution) + " ppm. It is advised to take a mask. ")
sleep(20)
clear()
elif 5000 <= pollution <= 40000:
print("The outside has a pollution level of " + str(pollution) + " ppm. It is advised not to go out. ")
sleep(20)
clear()
elif 40000 < pollution:
print("The outside has a pollution level of " + str(pollution) + " ppm. Please do not go out. ")
sleep(20)
clear()
else:
print("This is not a valid level.")
sleep(10)
clear()
elif function == 3:
# take timetable for database
o = ["Period 1", "Period 3"]
print("Timetable for today is")
print(o)
sleep(10)
clear()
elif function == 4:
food = 100000
sleep(100)
clear()
elif function == 5:
quit()
else:
print("That is not valid input")
sleep(10)
clear()
elif user == "T":
function = int(input("What would you like to do? 1) Check Internet Access 2) Go outside 3) Look at timetable "
"4) Get menu for today 5) Exit "))
if function == 1:
print("Checking internet access level")
print("Teacher Internet Access")
sleep(10)
clear()
elif function == 2:
print("Start pollution sensors")
pollution = int(input("Please input outside pollution level ppm: "))
if 0 <= pollution <= 350:
print("The outside has a pollution level of " + str(pollution) + " ppm. It is very safe to go out. ")
sleep(20)
clear()
elif 350 <= pollution <= 1000:
print("The outside has a pollution level of " + str(pollution) + " ppm. It is safe to go out. ")
sleep(20)
clear()
elif 1000 <= pollution <= 2000:
print(
"The outside has a pollution level of " + str(pollution) + "ppm. It is advised to not stay out for "
"too long. ")
sleep(20)
clear()
elif 2000 <= pollution <= 5000:
print("The outside has a pollution level of " + str(pollution) + " ppm. It is advised to take a mask. ")
sleep(20)
clear()
elif 5000 <= pollution <= 40000:
print("The outside has a pollution level of " + str(pollution) + " ppm. It is advised not to go out. ")
sleep(20)
clear()
elif 40000 < pollution:
print("The outside has a pollution level of " + str(pollution) + " ppm. Please do not go out. ")
sleep(20)
clear()
else:
print("This is not a valid level.")
sleep(10)
clear()
elif function == 3:
# take timetable for database
o = ["Period 1", "Period 3"]
print("Timetable for today is")
print(o)
sleep(10)
clear()
elif function == 4:
food = 10000
print(food)
sleep(100)
clear()
elif function == 5:
quit()
else:
print("That is not valid input")
sleep(10)
clear()
elif user == "A":
function = int(input("What would you like to do? 1) Check Internet Access 2) Go outside 3) Look at timetable "
"4) Get menu for today 5) Find a student 6) Exit "))
if function == 1:
print("Checking internet access level")
print("Student Internet Access")
sleep(10)
clear()
elif function == 2:
print("Start pollution sensors")
pollution = int(input("Please input outside pollution level ppm: "))
if 0 <= pollution <= 350:
print("The outside has a pollution level of " + str(pollution) + " ppm. It is very safe to go out. ")
sleep(20)
clear()
elif 350 <= pollution <= 1000:
print("The outside has a pollution level of " + str(pollution) + " ppm. It is safe to go out. ")
sleep(20)
clear()
elif 1000 <= pollution <= 2000:
print(
"The outside has a pollution level of " + str(pollution) + "ppm. It is advised to not stay out for "
"too long. ")
sleep(20)
clear()
elif 2000 <= pollution <= 5000:
print("The outside has a pollution level of " + str(pollution) + " ppm. It is advised to take a mask. ")
sleep(20)
clear()
elif 5000 <= pollution <= 40000:
print("The outside has a pollution level of " + str(pollution) + " ppm. It is advised not to go out. ")
sleep(20)
clear()
elif 40000 < pollution:
print("The outside has a pollution level of " + str(pollution) + " ppm. Please do not go out. ")
sleep(20)
clear()
else:
print("This is not a valid level.")
sleep(10)
clear()
elif function == 3:
# take timetable for database
o = ["Period 1", "Period 3"]
print("Timetable for today is")
print(o)
sleep(10)
clear()
elif function == 4:
food = 1000
sleep(100)
clear()
elif function == 5:
student = int(input("Student No. s"))
# Taken from sensor
ctrans = input("The location where the RFid is transmitting data from : ")
print("Student "+str(student)+" is in room " + ctrans)
elif function == 6:
quit()
else:
print("That is not valid input")
sleep(10)
clear()