-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathContactManager.py
More file actions
executable file
·55 lines (39 loc) · 1.08 KB
/
ContactManager.py
File metadata and controls
executable file
·55 lines (39 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
47
48
49
50
51
52
53
54
55
#!/usr/bin/python3
################################
# File Name:
# Author:
# Date:
# Class:
# Assignment:
# Purpose:
################################
# Include the ContactData.py file and import all of
# that file's contents.
from ContactData import *
def displayMenu() :
""" This function display the menu
"""
print("-1. Quit")
print(" 0. Display nicely to the screen all the entries")
print(" 1. Search and show entries only in the given office location")
print(" 2. Add an entry")
print(" 3. Delete an entry")
print(" 4. Search by First name (show all entries)")
print(" 5. Search by email (show the first entry)")
## EXTRA PRACTICE ##
print(" 6. Write the data to a file")
def main(theList) :
""" This is the main function
The menu will be displayed, a character will be
read from the user and the appropriate function will
be called to handle that menu item.
If an invalid menu item is provided the menu is displayed
again
"""
displayMenu()
choice = int(input(">>> "))
if -1 == choice :
return
# invoke main()
if __name__=="__main__" :
main(DATA)