pythonProject
pythonProject
Project Report
On
By
Prof. Chaugule G. B.
(2025-2026)
NEW SATARA COLLEGE OF ENGINEETING AND
MANAGEMENT KORTI-PANDARPUR
Certificate
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.
We hereby declare that the project report entitled “Contact Management System”
The partial fulfillment of the requirement for the award of the diploma of
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
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
the any university as the basic requirement of the university is students and
can mean the difference between success and failure because of the large
design and develop the Diploma and local admission process at the
1 Introduction 1
2 Objectives 3
3 Program 6
4 Output/Result 21
5 Conclusion 23
6 References 24
1. Introduction
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)
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: 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.
import sqlite3
root = Tk()
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.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()
fetch = cursor.fetchall()
cursor.close()
conn.close()
def SubmitData():
else:
tree.delete(*tree.get_children())
conn = sqlite3.connect("contact.db")
cursor = conn.cursor()
conn.commit()
cursor.close()
conn.close()
FIRSTNAME.set("")
LASTNAME.set("")
GENDER.set("")
AGE.set("")
ADDRESS.set("")
CONTACT.set("")
def UpdateData():
if GENDER.get() == "":
else:
tree.delete(*tree.get_children())
conn = sqlite3.connect("contact.db")
cursor = conn.cursor()
fetch = cursor.fetchall()
cursor.close()
conn.close()
FIRSTNAME.set("")
LASTNAME.set("")
GENDER.set("")
AGE.set("")
ADDRESS.set("")
CONTACT.set("")
def OnSelected(event):
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()
width = 400
height = 300
screen_width = root.winfo_screenwidth()
screen_height = root.winfo_screenheight()
UpdateWindow.resizable(0, 0)
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)
#===================LABELS==============================
lbl_title.pack(fill=X)
lbl_firstname.grid(row=0, sticky=W)
lbl_lastname.grid(row=1, sticky=W)
lbl_gender.grid(row=2, sticky=W)
lbl_age.grid(row=3, sticky=W)
lbl_address.grid(row=4, sticky=W)
#===================ENTRY===============================
firstname.grid(row=0, column=1)
lastname.grid(row=1, column=1)
RadioGroup.grid(row=2, column=1)
age.grid(row=3, column=1)
address.grid(row=4, column=1)
contact.grid(row=5, column=1)
#==================BUTTONS==============================
#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()
conn.commit()
cursor.close()
conn.close()
def AddNewWindow():
global NewWindow
FIRSTNAME.set("")
LASTNAME.set("")
GENDER.set("")
AGE.set("")
ADDRESS.set("")
CONTACT.set("")
NewWindow = Toplevel()
width = 400
height = 300
screen_width = root.winfo_screenwidth()
screen_height = root.winfo_screenheight()
NewWindow.resizable(0, 0)
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)
#===================LABELS==============================
lbl_title.pack(fill=X)
lbl_firstname.grid(row=0, sticky=W)
lbl_lastname.grid(row=1, sticky=W)
lbl_gender.grid(row=2, sticky=W)
lbl_age.grid(row=3, sticky=W)
lbl_address.grid(row=4, sticky=W)
lbl_contact.grid(row=5, sticky=W)
#===================ENTRY===============================
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.grid(row=3, column=1)
address.grid(row=4, column=1)
contact.grid(row=5, column=1)
#==================BUTTONS==============================
#============================FRAMES=========================
=============
Top.pack(side=TOP)
Mid.pack(side=TOP)
MidLeftPadding.pack(side=LEFT)
MidRight.pack(side=RIGHT, pady=10)
TableMargin.pack(side=TOP)
#============================LABELS=========================
=============
lbl_title.pack(fill=X)
#============================ENTRY==========================
=============
#============================BUTTONS========================
=============
btn_add.pack()
btn_delete.pack(side=RIGHT)
#============================TABLES=========================
=============
scrollbary.config(command=tree.yview)
scrollbary.pack(side=RIGHT, fill=Y)
scrollbarx.config(command=tree.xview)
scrollbarx.pack(side=BOTTOM, fill=X)
tree.pack()
tree.bind('<Double-Button-1>', OnSelected)
#============================INITIALIZATION==================
============
if __name__ == '__main__':
Database()
root.mainloop()
4. Output/Result
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