

I also added some code to ensure that the user inputs a sensible choice of input.Ĭhoosing 0 to mean print all contacts in Contact.summary (which should also not be a static method but a stand alone function or method of AddressBook) is not a good idea.

Msg_error = ':Įntry = input('NAME, SURNAME, NUMBER, EMAIL\n>').lower()Īddress_book = input('New entry: ') Each option has a funcion in the address book: add, modify, delete, view, view all, finish. The program now prompts the user for an option ranging from 0-5. # Prompts the user if there's no contact saved in address isempty(list): # Prints only the names saved in the address saved(): Print(address_book.number, '/', address_book.email) Print(address_book.name, address_book.surname, end=' / ') # otherwise it prints data of all entries saved in address book (fullnames, # This method prints prints all data of a specific entry it index is provided Return add(cls, name, surname, number, email): # contacts data and for showing if there's no contact saved on the address book.ĭef _init_(self, name, surname, number, email): Also there are static methods for showing a specific or all # Creating class named contacts with methods for editing and adding new As I'm still beginning to code any feedback would be very welcome.
#Contact book in python source code Offline
This offline phonebook application can save several numbers of contacts belonging to different fields.

Every person has many contacts in their list but may or may not classify contacts into groups. It can be accessed by the phone use only. This is an offline application which manages to save one’s, part of personal information like contact number, address and email id if applicable. This application will be very helpful for the people having a big list of contacts. Fields like friend, family, work, relative as per the requirement are included in this application. To avoid this confusion we have added few fields to currently existing phonebook which makes it a smart-phonebook. Creating a contact in our phonebook seems to be easy, but it becomes little confusing when we search for names in the contact list as two or more people may have the same name but different numbers. The main objective of Smart-phonebook application is to avoid confusion while searching for the name in the contacts list. By selecting the particular contact from the field or sub-field function like calling can be performed.
