Ejemplo n.º 1
0
import json
from AddressBook import *
if __name__ == '__main__':
    book = AddressBook()
    book.show()
Ejemplo n.º 2
0
# Authors:
#
# Name:                     Student ID:
# Amanda Burgos De Jesus    #97280
# Hiram Zengotita Hernandez #103450
# Ivan Santiago De Jesus    #85519
#

from AddressBook import *
from AddressBookWindow import *
from tkinter import *

root = Tk()
ab = AddressBook()
abw = AddressBookWindow(root, ab)

root.mainloop()
Ejemplo n.º 3
0
    contact_id = input('Enter contact ID which you want delete (type "all" to clear address book):\n')
    
    if contact_id == 'all':
        if confirmDelete('ALL'):
            abook.deleteAll()
    else:
        contact = abook.getContactByID(contact_id)
        if contact and confirmDelete(contact.name):
            abook.deleteContactByID(contact_id)

def confirmDelete(name):
    confirmation = input('You want to delete {0} contact(s). Are you sure? (y/N)'.format(name))
    return confirmation == 'y' or confirmation == 'Y'


abook = AddressBook(addressBookFile)
is_running = True

while is_running:
    option = input('''Select option:
    a - add new contact
    d - delete contact
    p - print all contacts
    q - quit
''')
    
    if option == 'p':
        abook.print()
    elif option == 'a':
        addContact()
    elif option == 'd':