-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainProgramLoop.py
123 lines (88 loc) · 3.3 KB
/
MainProgramLoop.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
import regexes
import debugcommands
import ArrayCommands
import maths
saveExpression = r'"url":'
WebArray = []
ProssesedArray = []
## this decides what to call and what to do
## just a while loop
running = True
print("launched, type help to view commands")
while running:
inp = input("input: ")
## help printout
if inp == "help" :
print("------ regexes, use these first ------")
print()
print("regex: lets you select what to save to the processed array")
print("useex: saves selected thing to the processed array (default saves website urls)")
print()
print("------ processing functions, use after regexes ------")
print()
print("findNames: finds domain names, needs processed array, creates the web array")
print("count: counts websites, needs web array, creates export array")
print("export: exports export array into a .txt file, for use in graphical analysis (use a spreadsheet lol, idk how to make python graphs)")
print()
print("------ math ------")
print()
print("mean: finds the mean")
print("median: finds the median")
print("mode: finds the mode")
print("deviation: finds the standard deviation")
print("gmean: finds the geometric mean")
print()
print("------ utility ------")
print()
print("clear: menu for clearing arrays")
print("cleanWebArray: uses a regex expression to filter the web array")
print("TTA: contents of processed text to processed array (usefull if useex was run and the program reloaded, saves time)")
print("ATT: contents of processed array to processed text (does not clear processed text)")
if inp == "regex" :
saveExpression = regexes.regex(saveExpression)
print("Done")
if inp == "useex" :
ProssesedArray = regexes.useex(saveExpression)
print("Done")
if inp == "count" :
expArray = ArrayCommands.count(WebArray)
print(expArray)
print("Done")
if inp == "TTA":
ProssesedArray = debugcommands.TTA(ProssesedArray)
print("Done")
if inp == "ATT":
debugcommands.ATT(ProssesedArray)
print("Done")
if inp == "findNames":
WebArray = ArrayCommands.findNames(ProssesedArray)
print("Done")
if inp == "cleanWebArray":
ArrayCommands.cleanWebArray(saveExpression, WebArray)
print("Done")
if inp == "export":
ArrayCommands.exportWebArray(expArray)
if inp == "deviation":
print(maths.SD(expArray))
if inp == "mean":
print(maths.mean(expArray))
if inp == "median":
print(maths.median(expArray))
if inp == "mode":
print(maths.mode(expArray))
if inp == "gmean":
print(maths.gmean(expArray))
if inp == "clear" :
## clears menu
print("PT: clears the ProssesedText.txt document")
print("PA: clears the ProssesedArray")
print("ALL: clears everything")
inp = input(":")
if inp == "PT":
debugcommands.PTclear
if inp == "PA":
ProssesedArray = debugcommands.PAclear
if inp == "ALL":
debugcommands.PTclear
ProssesedArray = debugcommands.PAclear
print("Done")