venuecros.blogg.se

Contact book python project
Contact book python project




contact book python project

This is a beginner-level project for those who are new to Python, or those who want a fun way to apply their coding skills.

#Contact book python project code#

Before starting this project, you should have some experience using lists and creating functions, as well as have some experience using Tkinter as these are the concepts that you will use and build upon as you code this project. This program focuses on creating a GUI using the Tkinter library, which is used to display the contacts and their contact information. Functions are also heavily used to add functionality to the program and to allow users to interact with the app by using the program’s buttons. These concepts are essential for any programmer to understand, and can be applied to any Python project.

contact book python project

Set the name field equal to the selected contact’s name Select the name and phone number of the user’s selected contact Set up the Tkinter window with dimensions of 550x300 pixelsĬreate a list called contactList and add some names and their associated phone numbersĬreate a string variable called name to store a contact’s nameĬreate a string variable called number to store a contact’s phone numberĬreate a scrollbar, orient it vertically and align it to the right of the screenĬreate a listbox to store values, and orient it to the right of the screenĪppend the given name and phone number to the contact list Users can delete contacts by selecting a name and then pressing the “delete” button.Users can add new contacts by entering in information and then clicking the “add” button.By selecting a name and clicking the view button, users can see that person’s information.Users will see a list of their contacts (The program will start with some pre-set values).

contact book python project

Set the phone number field equal to the selected contact’s phone numberĬreate a label with the text “name” and place it at (30, 20)Ĭreate an entry with the textvariable “name”, and place it at (130, 20)Ĭreate a label with the text “phone #” and place it at (30, 70)Ĭreate an entry with the textvariable “number”, and place it at (130, 70)Ĭreate a button with the text “add” and the command add()Ĭreate a button with the text “delete” and the command delete()Ĭreate a button with the text “view” and the command view()Ĭreate a button with the text “exit” and the command exit()ĬontactList. You may notice that each of these functions works by selecting the contact that the user selects, and then modifying it, whether that be by deleting it, adding it, or displaying the information. The exit function simply exits the window and the selectSet formats the names and allows users to select them. Note: Some of the functions have been named using all uppercase letters (such as EXIT or DELETE). This is because there are some pre-made methods that use these commands but do not perform the actions that we want, so we create some with all uppercase letters to allow the program to differentiate between the two. Step 4: Create the Main GUIįinally, we’re on to the last step, which will include creating buttons and labels for the GUI, as well as running the mainloop. We’ll start by creating labels to let the user know where to enter a contact’s name and phone number. Beside each label, we will also include an entry box where they can type in names and phone numbers to be stored as variables in the program.Create Python packages to share your code in a scalable and maintainable way.






Contact book python project