Address Book In Python With Source Code
The Address Book In Python is written in python programming language, This Address Book Python Project is an interesting project. The user can add the number of contact details and you can see the details stored in the list form. The user can delete the contact records if he/she wants to remove it. This is a simple GUI-base project which is very easy to understand and use.
A Python Address Book Example features is the user can make the list of contacts with their name, address, and keep them as records. You just have to type the contact information in the text fields and click on the add button to add the information on the record.
Also this Address Book In Python includes a downloadable Address Book Python Code for free, just find the downloadable source code below and click to start downloading.
To start creating a Address Book In Python, make sure that you have PyCharm IDE installed in your computer.
By the way if you are new to python programming and you don’t know what would be the the Python IDE to use, I have here a list of Best Python IDE for Windows, Linux, Mac OS that will suit for you. I also have here How to Download and Install Latest Version of Python on Windows.
Steps on how to create a Address Book In Python
Address Book In Python With Source Code
- Step 1: Create a project name.
First open Pycharm IDE and then create a “project name” after creating a project name click the “create” button.
- Step 2: Create a python file.
Second after creating a project name, “right click” your project name and then click “new” after that click the “python file“.
- Step 3: Name your python file.
Third after creating a python file, Name your python file after that click “enter“.
- Step 4: The actual code.
You are free to copy the code given below and download the full source code below.
Address Book In Python with source code below
The Code Given Below Is For Importing Libraries
import sys
sys.path.insert(0, 'GUI')
import tkinter as Tk
import db
import new
In the code given which is importing the given libraries.
The Code Given Below Is For The Get Data Module
def get_contact(contact):
"""Returns a contact.
Keyword arguments:
contact -- First and Last name of a contact entry
"""
entry = []
try:
if contact.split()[1]:
entry.append(contact.split()[0])
entry.append(contact.split()[1])
except:
entry.append('')
entry.append(contact.split()[0])
for row in db.get_entry(db.get_id(entry)):
return row
In this module which is the module for getting contact.
The Code Given Below Is For The Adding Data Module
def add_contact(contact):
"""Adds a contact to the database.
Keyword arguments:
contact -- List containing contact entry information
"""
db.insert_entry(contact)
In this module which is the module for adding the data.
The Code Given Below Is For The Removing Data Module
def remove_contact(contact):
"""Removes a contact.
Keyword arguments:
contact -- First and Last name of a contact entry
"""
entry = []
try:
entry.append(contact.split()[0])
except:
entry.append('')
try:
entry.append(contact.split()[1])
except:
entry.append('')
db.delete_entry(db.get_id(entry))
In this module which is the module for removing of the data.
The Code Given Below Is For The Modify Module
def edit_contact(entry_id, contact):
"""Edits a contact.
Keyword arguments:
entry_id -- rowid for contact entry
contact -- List containing contact entry information
"""
db.edit_entry(entry_id, contact)
In this module which is the module for modifying the data.
The Code Given Below Is For The Search Module
def search(search_string, sort):
"""Searches the database and returns the results.
Keyword arguments:
search_string -- (str) Search term
sort -- (str) Sorting method (Last Name or Zip)
"""
return db.search_entry(search_string, sort)
In this module which is the module for searching the data that store in the sqlite database.
Complete Source Code
import sys
sys.path.insert(0, 'GUI')
import tkinter as Tk
import db
import new
def get_contact(contact):
"""Returns a contact.
Keyword arguments:
contact -- First and Last name of a contact entry
"""
entry = []
try:
if contact.split()[1]:
entry.append(contact.split()[0])
entry.append(contact.split()[1])
except:
entry.append('')
entry.append(contact.split()[0])
for row in db.get_entry(db.get_id(entry)):
return row
def add_contact(contact):
"""Adds a contact to the database.
Keyword arguments:
contact -- List containing contact entry information
"""
db.insert_entry(contact)
def remove_contact(contact):
"""Removes a contact.
Keyword arguments:
contact -- First and Last name of a contact entry
"""
entry = []
try:
entry.append(contact.split()[0])
except:
entry.append('')
try:
entry.append(contact.split()[1])
except:
entry.append('')
db.delete_entry(db.get_id(entry))
def edit_contact(entry_id, contact):
"""Edits a contact.
Keyword arguments:
entry_id -- rowid for contact entry
contact -- List containing contact entry information
"""
db.edit_entry(entry_id, contact)
def search(search_string, sort):
"""Searches the database and returns the results.
Keyword arguments:
search_string -- (str) Search term
sort -- (str) Sorting method (Last Name or Zip)
"""
return db.search_entry(search_string, sort)
if __name__ == "__main__":
root = Tk.Tk()
new.New_AddBookWindow(root)
root.mainloop()
Downloadable Source Code
I have here the list of Best Python Project with Source code free to download for free, I hope this can help you a lot.
Summary
The Address Book In Python is written in Python programming language, Python is very smooth to research the syntax emphasizes readability and it is able to reduces time ingesting in developing.
Also in this tutorial is the simplest way for the beginners or the student to enhance their logical skills in programming. and also in this System project is the way for the students or beginners in designing and developing the system’s.
Related Articles
- Loan Calculator in Python with Source Code
- Python Code For Food Ordering System
- College Management System in Python with Source Code
- Ticket Booking System In Python With Source Code
- Snakes and Ladders Game in Python with Source Code
- Code For Game in Python: Python Game Projects With Source Code
- Stickman Game in Python with Source Code
- Tank Game Python with Source Code
- Tetris In Python Code
- Mario Game In Python With Source Code
- Hangman Game In Python With Source Code
- Aircraft War Game in Python with Source Code
- Snake Game In Python Code
- How to Make Bouncing Ball Game in Python with Source Code
- How to Create Rock-Paper-Scissor Game in Python
Inquiries
If you have any questions or suggestions about Address Book In Python , please feel free to leave a comment below.