""" """ from contact import Contact import contact_service c = Contact("lee", "*****@*****.**", '010-1231-1232', 'seoul') contact_service.regist_contact(c) # contact 주소 전체보기 contacts = contact_service.view_all_contact() for contact in contacts: print(contact.name, contact.email, contact.phone_number, contact.address)
""" main.py """ from contact import Contact import contact_service # 최초 한번 생성 contact_service.create_contact_data() # 새로운 데이터를 입력한다. c = Contact('Cocomo', '*****@*****.**', '010', 'Seoul') c2 = Contact('Cocomo2', '*****@*****.**', '010', 'Seoul') contact_service.regist_contact(c) contact_service.regist_contact(c2) # view_all_contact 함수를 통해 모든 데이터를 가져온다. contact_dic = contact_service.view_all_contact() for contact in contact_dic.values(): print(contact.name, contact.email, contact.pnum, contact.addr, sep=" / ")
""" """ from contact import Contact import contact_service c = Contact("lee", "*****@*****.**", '010-1231-1232', 'seoul') contact_service.regist_contact(c) # contact 주소 전체보기 contacts = contact_service.view_all_contact() for contact in contacts : print(contact.name, contact.email, contact.phone_number, contact.address)