-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
46 lines (36 loc) · 1.08 KB
/
Copy pathmain.py
File metadata and controls
46 lines (36 loc) · 1.08 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
import time
from classes.StringManager import StringManager
from classes.GraphManager import GraphManager
def main():
gm = GraphManager()
ui = StringManager(gm)
wrong_command = False
while True: # Main Loop
options = []
if gm.current_graph is not None:
options += ["d-graph details"]
options += ["l-load_graph", "g-generate graph", "q-quit"]
ui.print(
sentence="",
options=options,
wrong_command=wrong_command
)
command = input("Enter command: ")
if command == "q":
return
elif command == "l":
wrong_command = False
if ui.load_graph():
ui.graph_analysis()
elif command == "g":
wrong_command = False
if ui.generate_graph():
ui.graph_analysis()
# Graph loaded
elif gm.current_graph and command == "d":
wrong_command = False
ui.graph_analysis()
else:
wrong_command = True
if __name__ == "__main__":
main()