-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmodify.py
More file actions
36 lines (32 loc) · 1.02 KB
/
modify.py
File metadata and controls
36 lines (32 loc) · 1.02 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
import subprocess as sp
import colours
from insert import insert
from delete import delete
from update import update
def modify():
while(1):
tmp = sp.call('clear', shell = True)
print("Choose an operation:")
print(f"{colours.bcolors.OKCYAN}")
print("1. Insert")
print("2. Delete")
print("3. Update")
print(f"{colours.bcolors.ENDC}{colours.bcolors.WARNING}")
print("4. Back")
print("5. Exit")
print(f"{colours.bcolors.ENDC}")
ch = input("Enter choice: ").lower()
tmp = sp.call('clear', shell = True)
if ch == '1' or ch == 'insert':
insert()
elif ch == '2' or ch == 'delete':
delete()
elif ch == '3' or ch == 'update':
update()
elif ch == '4' or ch == 'back':
return
elif ch == '5' or ch == 'exit':
exit()
else:
print(f"{colours.bcolors.RED}Invalid Option{colours.bcolors.ENDC}")
input("Enter any key to continue: ")