0% found this document useful (0 votes)
1 views

pythonProject

The document is a project report for a 'Contact Management System' developed by students for their Diploma in Computer Engineering. It outlines the system's objectives, features, and implementation using Python and Tkinter, focusing on user-friendly contact management through CRUD operations. The report includes acknowledgments, a declaration of originality, and a structured index of the content presented.

Uploaded by

rupeshpawar214
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views

pythonProject

The document is a project report for a 'Contact Management System' developed by students for their Diploma in Computer Engineering. It outlines the system's objectives, features, and implementation using Python and Tkinter, focusing on user-friendly contact management through CRUD operations. The report includes acknowledgments, a declaration of originality, and a structured index of the content presented.

Uploaded by

rupeshpawar214
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 30

“A”

Project Report
On

“Contact Management System”


Submitted & Present in the fulfillment of the
requirement for the award of
Diploma in Computer Engineering

By

Mr. Sachin Maruti Kedar


Mr. Rushikesh Dnyaneshwar Lokhande
Mr. Sanket Mahadev Pawar
Mr. Rupesh Dnyaneshwar Pawar
Under the Guidance of

Prof. Chaugule G. B.

DEPARTMENT OF COMPUTER ENGINEERING

NEW SATARA COLLEGE OF ENGINEERING & MANAGEMENT POLY

(2025-2026)
NEW SATARA COLLEGE OF ENGINEETING AND
MANAGEMENT KORTI-PANDARPUR

Certificate

This is to certify that the project report “Contact Management System”

has been presented successfully and submitted by.

Name of the Student: - Seat No.

Mr. Sachin Kedar


Mr. Rushikesh Lokhande
Mr. Sanket Pawar
Mr. Rupesh Pawar

Student of CO (Computer Engineering) class in the fulfilment for the award of Diploma in
Computer Engineering as per curriculum laid by Maharashtra State Board of Technical
Education, Mumbai during the academic year 2024-2025.

Project Guide H.O. D Principal

(Prof. Chaugule G. B.) (Prof. Puri S.B.) (Prof. Londhe V.H.)


Declaration

We hereby declare that the project report entitled “Contact Management System”

is completed and submitted by me for the award of diploma engineering in

Computer Engineering branch, NSCOEM, College Korti, Pandharpur.

The partial fulfillment of the requirement for the award of the diploma of

COMPUTER ENGINEERING is a project work carried out by me under the

guidance of Prof. Puri S.B. I further declare that the work reported in this

project has not submitted and will not be submitted, either in part or full, for

the award of diploma engineering in this institute or any other university or

examination body.

PLACE- KORTI,
PANDARPUR
DATE-
Acknowledgement

I hereby declare that the work presented in this Mini project report
entitled, “Contact Management System” in partial fulfilment for the
Diploma of "Computer Engineering" in Computer Science & Engineering.
Our extreme gratitude to Prof. Puri S. B. who guided us throughout the
project. Without his willing disposition, spirit of accommodation,
frankness, timely clarification and above all faith in us, this project could
not have been completed in due time.
Abstract

Student admissions are playing very important role in major activities of

the any university as the basic requirement of the university is students and

without student’s university cannot survive. An inefficient admission

application system may reduce the number of admitted student in the

esteemed university because if the admission system is slow and having

many delays in the process. When considering Palestine students this is

unfortunate, but when considering Palestinian international students, it

can mean the difference between success and failure because of the large

sums of money each brings to the university’s economy. This project is to

design and develop the Diploma and local admission process at the

institute to develop an easy-to-use system that will significantly quicken

and simplify this process.


INDEX

SR.NO TOPIC PAGE NO

1 Introduction 1

2 Objectives 3

3 Program 6

4 Output/Result 21

5 Conclusion 23

6 References 24
1. Introduction

The Contact Management System is a user-friendly Python application designed to


help individuals manage their personal contacts. This system is built using Tkinter, a
popular GUI (Graphical User Interface) toolkit for Python, allowing users to interact
with the system through a visual interface rather than a command-line interface.
Tkinter provides an intuitive and interactive environment for users to perform
operations such as adding, updating, deleting, and viewing contacts.
The system is designed for small-scale personal use and stores contact information
temporarily in memory during the program's execution. The data is stored in a list or
dictionary structure within the program, which means that once the application is
closed, the contact data is erased. This makes it an ideal solution for quick, temporary
contact management where data persistence across sessions is not required.
Some of the key features and functionalities of this system include:
 Adding Contacts: Users can easily add new contacts by entering the required details
such as First Name, Last Name, Age, Gender, Address, and Contact Number. The
information is immediately added to the list and displayed in a table format for easy
viewing.
 Viewing Contacts: The system displays all existing contacts in a table (using
Tkinter’s Treeview widget), where users can see the details at a glance. This makes it
easy to access and manage contact information.
 Updating Contacts: If any contact information needs to be changed, users can select
the contact from the table, edit the fields, and update the contact details. The updated
contact information is immediately reflected in the displayed list.
 Deleting Contacts: Users can select and delete any contact from the list when it is no
longer needed.
Since the system does not require any external database setup (like SQLite or
MySQL), it is lightweight, easy to use, and can be executed directly from the Python
environment. This makes it particularly useful for quick data entry and temporary
storage without worrying about configuring databases.
This project is a perfect starting point for learning about both GUI development in
Python and basic data management concepts, as it focuses on core functionality with
easy-to-understand logic. However, for larger-scale projects, one might consider using
a database like SQLite or integrating file storage methods to persist the contact data
between sessions.
The Contact Management System is also an excellent base for adding more complex
features, such as contact search, filtering by attributes (like gender or age), and
exporting contact data to a file (e.g., CSV or Excel format). These additional features
can be added as part of future improvements to the system.
2. Objectives

1. Create a User Interface (UI)

Goal: Build a simple and attractive window using Tkinter where users can interact with
the program.
What it means:
 The user should see input fields like Name, Phone Number, Email, etc.
 There should be buttons like Add, Update, Delete, and Clear.
 Proper labels and layout should be used to make the design clean.
Why it’s important:
 A clean UI makes the program user-friendly and easy to understand, even for non-
tech users.
Example:
root = Tk()
root.title("Contact Manager")
Label(root, text="Name").grid(row=0, column=0)

2. Implement CRUD Operations

CRUD stands for:


 Create (Add a new contact)
 Read (View all saved contacts)
 Update (Edit a contact)
 Delete (Remove a contact)
Goal: Add full CRUD functionality using buttons and code logic.
Why it’s important:
 Users should have full control over their contact list — they should be able to add, fix
mistakes, and remove outdated contacts.
Example:
contacts.append({"Name": name, "Phone": phone})
3. Data Storage

Goal: Use temporary in-memory data structures like lists or dictionaries to store
contacts.
Why this method?
 It’s simple and fast.
 Perfect for small projects or demos.
 No need to connect a database.
Example:
contacts = [] # List to store multiple contact dictionaries
Limitation:
 Data will be lost when the program is closed.
 For permanent storage, use a file or database like SQLite.

4. Data Validation

Goal: Check if the user has entered proper values before saving.
What to check:
 Fields must not be empty
 Phone number should be digits
 Email should contain @
Why it’s important:
 Prevents saving wrong or incomplete data.
 Helps maintain clean and useful contact records.
Example:
if name == "" or phone == "":
messagebox.showerror("Error", "All fields are required")

5. User Experience

Goal: Make the program easy to use, even for beginners.


How to improve UX:
 Clear button names and layout
 Show success or error messages
 Use popups for confirmation
 Organize screen space
Why it’s important:
 If the app is hard to use, users won’t use it.
 A good experience makes the app feel professional.
Example:
messagebox.showinfo("Success", "Contact added successfully!")

6. Display Contacts (Treeview)

Goal: Show the list of saved contacts in a table format using Treeview.
Why Treeview?
 Looks like an Excel table
 Easy to view, select, and update contacts
 Supports columns and headings
What to include in the table:
 Name
 Phone Number
 Email
Example:
tree = ttk.Treeview(root, columns=("Name", "Phone", "Email"), show='headings')
tree.heading("Name", text="Name")
3. Program

The Contact Management System is implemented using Python and Tkinter for the
graphical interface. Below are the core components of the program:
 Tkinter GUI Setup: The main window is created using Tk() from the Tkinter library.
It includes a contact form, buttons for adding, updating, and deleting contacts, and a
table to display the contacts.
 Data Storage (In-Memory): A Python list (or dictionary) is used to store the contact
data temporarily.
 contacts = []
 CRUD Operations:
o Add Contact: Collect input from text fields and store the data in the list.
o Update Contact: Modify the selected contact's information.
o Delete Contact: Remove the selected contact from the list.
o Display Contacts: The Treeview widget is used to show contacts in a tabular
format, displaying fields like First Name, Last Name, Age, Gender, Address,
and Contact Number.
 Input Validation: Before adding or updating contact information, the program
ensures that all required fields are filled out and that the phone number is in the
correct format.

from tkinter import *

import sqlite3

import tkinter.ttk as ttk

import tkinter.messagebox as tkMessageBox

root = Tk()

root.title("Contact Management System")

width = 700
height = 400

screen_width = root.winfo_screenwidth()

screen_height = root.winfo_screenheight()

x = (screen_width/2) - (width/2)

y = (screen_height/2) - (height/2)

root.geometry("%dx%d+%d+%d" % (width, height, x, y))

root.resizable(0, 0)

root.config(bg="#6666ff")

#============================VARIABLES======================
=============

FIRSTNAME = StringVar()

LASTNAME = StringVar()

GENDER = StringVar()

AGE = StringVar()

ADDRESS = StringVar()

CONTACT = StringVar()

#============================METHODS=======================
==============

def Database():

conn = sqlite3.connect("contact.db")
cursor = conn.cursor()

cursor.execute("CREATE TABLE IF NOT EXISTS `member` (mem_id INTEGER


NOT NULL PRIMARY KEY AUTOINCREMENT, firstname TEXT, lastname
TEXT, gender TEXT, age TEXT, address TEXT, contact TEXT)")

cursor.execute("SELECT * FROM `member` ORDER BY `lastname` ASC")

fetch = cursor.fetchall()

for data in fetch:

tree.insert('', 'end', values=(data))

cursor.close()

conn.close()

def SubmitData():

if FIRSTNAME.get() == "" or LASTNAME.get() == "" or GENDER.get() == "" or


AGE.get() == "" or ADDRESS.get() == "" or CONTACT.get() == "":

result = tkMessageBox.showwarning('', 'Please Complete The Required Field',


icon="warning")

else:

tree.delete(*tree.get_children())

conn = sqlite3.connect("contact.db")

cursor = conn.cursor()

cursor.execute("INSERT INTO `member` (firstname, lastname, gender, age, address,


contact) VALUES(?, ?, ?, ?, ?, ?)", (str(FIRSTNAME.get()), str(LASTNAME.get()),
str(GENDER.get()), int(AGE.get()), str(ADDRESS.get()), str(CONTACT.get())))

conn.commit()

cursor.execute("SELECT * FROM `member` ORDER BY `lastname` ASC")


fetch = cursor.fetchall()

for data in fetch:

tree.insert('', 'end', values=(data))

cursor.close()

conn.close()

FIRSTNAME.set("")

LASTNAME.set("")

GENDER.set("")

AGE.set("")

ADDRESS.set("")

CONTACT.set("")

def UpdateData():

if GENDER.get() == "":

result = tkMessageBox.showwarning('', 'Please Complete The Required Field',


icon="warning")

else:

tree.delete(*tree.get_children())

conn = sqlite3.connect("contact.db")

cursor = conn.cursor()

cursor.execute("UPDATE `member` SET `firstname` = ?, `lastname` = ?, `gender` =?,


`age` = ?, `address` = ?, `contact` = ? WHERE `mem_id` = ?",
(str(FIRSTNAME.get()), str(LASTNAME.get()), str(GENDER.get()), str(AGE.get()),
str(ADDRESS.get()), str(CONTACT.get()), int(mem_id)))
conn.commit()

cursor.execute("SELECT * FROM `member` ORDER BY `lastname` ASC")

fetch = cursor.fetchall()

for data in fetch:

tree.insert('', 'end', values=(data))

cursor.close()

conn.close()

FIRSTNAME.set("")

LASTNAME.set("")

GENDER.set("")

AGE.set("")

ADDRESS.set("")

CONTACT.set("")

def OnSelected(event):

global mem_id, UpdateWindow

curItem = tree.focus()

contents =(tree.item(curItem))

selecteditem = contents['values']

mem_id = selecteditem[0]

FIRSTNAME.set("")

LASTNAME.set("")

GENDER.set("")
AGE.set("")

ADDRESS.set("")

CONTACT.set("")

FIRSTNAME.set(selecteditem[1])

LASTNAME.set(selecteditem[2])

AGE.set(selecteditem[4])

ADDRESS.set(selecteditem[5])

CONTACT.set(selecteditem[6])

UpdateWindow = Toplevel()

UpdateWindow.title("Contact Management System")

width = 400

height = 300

screen_width = root.winfo_screenwidth()

screen_height = root.winfo_screenheight()

x = ((screen_width/2) + 450) - (width/2)

y = ((screen_height/2) + 20) - (height/2)

UpdateWindow.resizable(0, 0)

UpdateWindow.geometry("%dx%d+%d+%d" % (width, height, x, y))

if 'NewWindow' in globals():

NewWindow.destroy()

#===================FRAMES==============================

FormTitle = Frame(UpdateWindow)
FormTitle.pack(side=TOP)

ContactForm = Frame(UpdateWindow)

ContactForm.pack(side=TOP, pady=10)

RadioGroup = Frame(ContactForm)

Male = Radiobutton(RadioGroup, text="Male", variable=GENDER,


value="Male", font=('arial', 14)).pack(side=LEFT)

Female = Radiobutton(RadioGroup, text="Female", variable=GENDER,


value="Female", font=('arial', 14)).pack(side=LEFT)

#===================LABELS==============================

lbl_title = Label(FormTitle, text="Updating Contacts", font=('arial', 16),


bg="orange", width = 300)

lbl_title.pack(fill=X)

lbl_firstname = Label(ContactForm, text="Firstname", font=('arial', 14), bd=5)

lbl_firstname.grid(row=0, sticky=W)

lbl_lastname = Label(ContactForm, text="Lastname", font=('arial', 14), bd=5)

lbl_lastname.grid(row=1, sticky=W)

lbl_gender = Label(ContactForm, text="Gender", font=('arial', 14), bd=5)

lbl_gender.grid(row=2, sticky=W)

lbl_age = Label(ContactForm, text="Age", font=('arial', 14), bd=5)

lbl_age.grid(row=3, sticky=W)

lbl_address = Label(ContactForm, text="Address", font=('arial', 14), bd=5)

lbl_address.grid(row=4, sticky=W)

lbl_contact = Label(ContactForm, text="Contact", font=('arial', 14), bd=5)


lbl_contact.grid(row=5, sticky=W)

#===================ENTRY===============================

firstname = Entry(ContactForm, textvariable=FIRSTNAME, font=('arial', 14))

firstname.grid(row=0, column=1)

lastname = Entry(ContactForm, textvariable=LASTNAME, font=('arial', 14))

lastname.grid(row=1, column=1)

RadioGroup.grid(row=2, column=1)

age = Entry(ContactForm, textvariable=AGE, font=('arial', 14))

age.grid(row=3, column=1)

address = Entry(ContactForm, textvariable=ADDRESS, font=('arial', 14))

address.grid(row=4, column=1)

contact = Entry(ContactForm, textvariable=CONTACT, font=('arial', 14))

contact.grid(row=5, column=1)

#==================BUTTONS==============================

btn_updatecon = Button(ContactForm, text="Update", width=50,


command=UpdateData)

btn_updatecon.grid(row=6, columnspan=2, pady=10)

#fn1353p

def DeleteData():

if not tree.selection():
result = tkMessageBox.showwarning('', 'Please Select Something First!',
icon="warning")

else:

result = tkMessageBox.askquestion('', 'Are you sure you want to delete this record?',
icon="warning")

if result == 'yes':

curItem = tree.focus()

contents =(tree.item(curItem))

selecteditem = contents['values']

tree.delete(curItem)

conn = sqlite3.connect("contact.db")

cursor = conn.cursor()

cursor.execute("DELETE FROM `member` WHERE `mem_id` = %d" %


selecteditem[0])

conn.commit()

cursor.close()

conn.close()

def AddNewWindow():

global NewWindow

FIRSTNAME.set("")

LASTNAME.set("")

GENDER.set("")

AGE.set("")
ADDRESS.set("")

CONTACT.set("")

NewWindow = Toplevel()

NewWindow.title("Contact Management System")

width = 400

height = 300

screen_width = root.winfo_screenwidth()

screen_height = root.winfo_screenheight()

x = ((screen_width/2) - 455) - (width/2)

y = ((screen_height/2) + 20) - (height/2)

NewWindow.resizable(0, 0)

NewWindow.geometry("%dx%d+%d+%d" % (width, height, x, y))

if 'UpdateWindow' in globals():

UpdateWindow.destroy()

#===================FRAMES==============================

FormTitle = Frame(NewWindow)

FormTitle.pack(side=TOP)

ContactForm = Frame(NewWindow)

ContactForm.pack(side=TOP, pady=10)

RadioGroup = Frame(ContactForm)

Male = Radiobutton(RadioGroup, text="Male", variable=GENDER,


value="Male", font=('arial', 14)).pack(side=LEFT)
Female = Radiobutton(RadioGroup, text="Female", variable=GENDER,
value="Female", font=('arial', 14)).pack(side=LEFT)

#===================LABELS==============================

lbl_title = Label(FormTitle, text="Adding New Contacts", font=('arial', 16),


bg="#66ff66", width = 300)

lbl_title.pack(fill=X)

lbl_firstname = Label(ContactForm, text="Firstname", font=('arial', 14), bd=5)

lbl_firstname.grid(row=0, sticky=W)

lbl_lastname = Label(ContactForm, text="Lastname", font=('arial', 14), bd=5)

lbl_lastname.grid(row=1, sticky=W)

lbl_gender = Label(ContactForm, text="Gender", font=('arial', 14), bd=5)

lbl_gender.grid(row=2, sticky=W)

lbl_age = Label(ContactForm, text="Age", font=('arial', 14), bd=5)

lbl_age.grid(row=3, sticky=W)

lbl_address = Label(ContactForm, text="Address", font=('arial', 14), bd=5)

lbl_address.grid(row=4, sticky=W)

lbl_contact = Label(ContactForm, text="Contact", font=('arial', 14), bd=5)

lbl_contact.grid(row=5, sticky=W)

#===================ENTRY===============================

firstname = Entry(ContactForm, textvariable=FIRSTNAME, font=('arial', 14))

firstname.grid(row=0, column=1)
lastname = Entry(ContactForm, textvariable=LASTNAME, font=('arial', 14))

lastname.grid(row=1, column=1)

RadioGroup.grid(row=2, column=1)

age = Entry(ContactForm, textvariable=AGE, font=('arial', 14))

age.grid(row=3, column=1)

address = Entry(ContactForm, textvariable=ADDRESS, font=('arial', 14))

address.grid(row=4, column=1)

contact = Entry(ContactForm, textvariable=CONTACT, font=('arial', 14))

contact.grid(row=5, column=1)

#==================BUTTONS==============================

btn_addcon = Button(ContactForm, text="Save", width=50, command=SubmitData)

btn_addcon.grid(row=6, columnspan=2, pady=10)

#============================FRAMES=========================
=============

Top = Frame(root, width=500, bd=1, relief=SOLID)

Top.pack(side=TOP)

Mid = Frame(root, width=500, bg="#6666ff")

Mid.pack(side=TOP)

MidLeft = Frame(Mid, width=100)


MidLeft.pack(side=LEFT, pady=10)

MidLeftPadding = Frame(Mid, width=370, bg="#6666ff")

MidLeftPadding.pack(side=LEFT)

MidRight = Frame(Mid, width=100)

MidRight.pack(side=RIGHT, pady=10)

TableMargin = Frame(root, width=500)

TableMargin.pack(side=TOP)

#============================LABELS=========================
=============

lbl_title = Label(Top, text="Contact Management System", font=('arial', 16),


width=500)

lbl_title.pack(fill=X)

#============================ENTRY==========================
=============

#============================BUTTONS========================
=============

btn_add = Button(MidLeft, text="+ ADD NEW", bg="#66ff66",


command=AddNewWindow)

btn_add.pack()

btn_delete = Button(MidRight, text="DELETE", bg="red", command=DeleteData)

btn_delete.pack(side=RIGHT)
#============================TABLES=========================
=============

scrollbarx = Scrollbar(TableMargin, orient=HORIZONTAL)

scrollbary = Scrollbar(TableMargin, orient=VERTICAL)

tree = ttk.Treeview(TableMargin, columns=("MemberID", "Firstname", "Lastname",


"Gender", "Age", "Address", "Contact"), height=400, selectmode="extended",
yscrollcommand=scrollbary.set, xscrollcommand=scrollbarx.set)

scrollbary.config(command=tree.yview)

scrollbary.pack(side=RIGHT, fill=Y)

scrollbarx.config(command=tree.xview)

scrollbarx.pack(side=BOTTOM, fill=X)

tree.heading('MemberID', text="MemberID", anchor=W)

tree.heading('Firstname', text="Firstname", anchor=W)

tree.heading('Lastname', text="Lastname", anchor=W)

tree.heading('Gender', text="Gender", anchor=W)

tree.heading('Age', text="Age", anchor=W)

tree.heading('Address', text="Address", anchor=W)

tree.heading('Contact', text="Contact", anchor=W)

tree.column('#0', stretch=NO, minwidth=0, width=0)

tree.column('#1', stretch=NO, minwidth=0, width=0)

tree.column('#2', stretch=NO, minwidth=0, width=80)

tree.column('#3', stretch=NO, minwidth=0, width=120)

tree.column('#4', stretch=NO, minwidth=0, width=90)

tree.column('#5', stretch=NO, minwidth=0, width=80)


tree.column('#6', stretch=NO, minwidth=0, width=120)

tree.column('#7', stretch=NO, minwidth=0, width=120)

tree.pack()

tree.bind('<Double-Button-1>', OnSelected)

#============================INITIALIZATION==================
============

if __name__ == '__main__':

Database()

root.mainloop()
4. Output/Result

After the program is executed, the following outputs are displayed:


 Graphical User Interface (GUI): A window where the user can:
o Add a new contact by entering details and clicking the "Submit" button.
o Edit an existing contact by selecting it from the table and clicking "Update".
o Delete a contact by selecting it and clicking "Delete".
 Contact List in Table: The Treeview displays a list of contacts in a tabular format:
 | MemberID | Firstname | Lastname | Gender | Age | Address | Contact |
 |----------|-----------|----------|--------|-----|---------------|-------------|
 |1 | John | Doe | Male | 25 | 123 Street | 1234567890 |
 |2 | Jane | Smith | Female | 30 | 456 Avenue | 9876543210 |
 Real-Time Updates: When a new contact is added, the list refreshes automatically.
Similarly, when a contact is updated or deleted, the table reflects the changes.
5. Conclusion

 The Contact Management System provides a simple and effective way to manage
personal contact information.
 It utilizes in-memory storage, making it lightweight and easy to implement.
However, this means the data will be lost when the program is closed, which may not
be suitable for long-term use.
 The program demonstrates basic CRUD functionality, real-time updates, and input
validation.
 While the system works well for small projects or temporary data management, it can
be extended by integrating databases like SQLite for persistent data storage if
required.
 The system is a good foundation for learning GUI development in Python and can be
easily enhanced with additional features such as search, sort, or advanced data
validation.
6. References

 Python Official Documentation: https://docs.python.org/3/


 Tkinter Documentation: https://tkdocs.com/
 Python Tkinter Tutorial: https://www.pythontutorial.net/tkinter/
 SQLite Documentation (for future enhancements):
https://www.sqlite.org/docs.html

You might also like