-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathguilloBook.py
46 lines (39 loc) · 1.37 KB
/
guilloBook.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
import sys
import modulesBook
import modulesCMD
book = []
sysOps = sys.platform
modulesCMD.clearScreen(sysOps)
while True:
print("The book is empty...\n")
itemsNumber = modulesCMD.menu() #Get the number options in the modulesCMD
#Control the input option selection
try:
funBook = int(input("Select one option: "))
except ValueError:
print("This is not an option")
modulesCMD.clearScreen(sysOps)
continue
if funBook > itemsNumber:
print("This is not an option")
modulesCMD.clearScreen(sysOps)
continue
else:
if funBook == 1: #This option adds a new contact to the book
modulesBook.addRecord(book)
modulesCMD.clearScreen(sysOps)
continue
elif funBook == 2: #This option updates a contact from the book
modulesBook.editRecord(book)
modulesCMD.clearScreen(sysOps)
continue
elif funBook == 3: #This option deletes a contact from the book
modulesBook.delRecord(book)
modulesCMD.clearScreen(sysOps)
elif funBook == 4: #This option lists every contact to the book
modulesBook.contactList(book)
modulesCMD.clearScreen(sysOps)
continue
elif funBook == 5: #This option close the program
modulesCMD.clearScreen(sysOps)
exit()