-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
36 lines (28 loc) · 851 Bytes
/
Copy pathmain.py
File metadata and controls
36 lines (28 loc) · 851 Bytes
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
import helper_functions as helper
def main():
choice = helper.print_main_menu()
exit_choice = "8"
# Dictionary to convert user input into a function
top_level_functions = {
"1": helper.rent_item,
"2": helper.return_item,
"3": helper.grant_extension,
"4": helper.search_tables,
"5": helper.add_item,
"6": helper.add_customer,
"7": helper.edit_customer,
}
# Main loop
while choice != exit_choice:
if choice in top_level_functions.keys():
top_level_functions[choice]()
else:
print("Choice unrecognised")
helper.save_changes()
print()
choice = helper.print_main_menu()
helper.close_connection()
print("Successfully saved changes, Goodbye!")
print()
if __name__ == '__main__':
main()