-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmenu_sel.py
More file actions
29 lines (29 loc) · 890 Bytes
/
menu_sel.py
File metadata and controls
29 lines (29 loc) · 890 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
# Filename: menu_sel.py
def menu_sel(opts):
menu_ind = []
menu_dict = {}
menu = []
index = 0
d_ind = 0
for i in range(0, len(opts)):
for o in opts:
if index == 0:
menu_ind.append(' < ')
menu_ind.append(o)
menu_ind.append(' >\n')
else:
if index == d_ind:
menu_ind.append(' < ')
menu_ind.append(o)
menu_ind.append(' >\n')
else:
menu_ind.append(' ')
menu_ind.append(o)
menu_ind.append('\n')
index += 1
menu.append(''.join(menu_ind))
menu_ind = []
d_ind += len(opts) + 1
for i in range(0, len(menu)):
menu_dict[i+1] = menu[i]
return menu_dict