-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
50 lines (37 loc) · 1.15 KB
/
main.py
File metadata and controls
50 lines (37 loc) · 1.15 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
from variables import set
from variables import get
from os import rmdir
from time import sleep
def initiate():
data = []
threads = []
try:
total = get.connections(data, threads)
answers = get.answers()
while any([x for x in threads if x.isAlive()]):
sleep(1)
rmdir('TemporaryFiles')
set.data(answers, data)
set.output(total, data)
return answers
except Exception as e: print(e)#print('No WIFI')
def refresh(answers):
### KEEPS CHOICES FROM LAST SESSION BUT UPDATES NUMBERS
data = []
try:
total = get.connections(data)
set.data(answers, data)
set.output(total, data)
except: print('No WIFI')
if __name__ == '__main__':
# First Run
answers = []
Uinput = ''
while Uinput.lower() != 'exit':
if Uinput.lower() == 'refresh':
refresh(answers) # Refreshes previous answers
else: # Redoes the program
answers = initiate()
Uinput = ''
while Uinput.lower() != 'refresh' and Uinput.lower() != 'exit' and Uinput.lower() != 'redo':
Uinput = input('Redo/Refresh/Exit\n')