0% found this document useful (0 votes)
5 views27 pages

Cs Project

The document outlines a project for a Contact Book application developed by students of SNS Academy under the guidance of Mrs. Deepika.C. It includes sections on Python programming, project introduction, system requirements, backend and frontend details, as well as acknowledgments and limitations. The project aims to facilitate the storage and management of contact information using Python and MySQL.

Uploaded by

sanjeev2solve4u
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)
5 views27 pages

Cs Project

The document outlines a project for a Contact Book application developed by students of SNS Academy under the guidance of Mrs. Deepika.C. It includes sections on Python programming, project introduction, system requirements, backend and frontend details, as well as acknowledgments and limitations. The project aims to facilitate the storage and management of contact information using Python and MySQL.

Uploaded by

sanjeev2solve4u
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/ 27

SNS ACADEMY

COMPUTER SCIENCE (083)


PROJECT
2024-2025
TOPIC:
CONTACT BOOK
GUIDED BY:- Mrs.Deepika.C

SUBMITTED BY: SANJEEV.G


MANOJ.ND
JUANILE FERNANDO.J

CLASS AND SECTION: XII-A


ROLL NUMBER: 12A-28
12A-18
12A-17
TABLE OF CONTENTS

CERTIFICATE
ACKNOWLEDGEMENT.
INTRODUCTION TO PYTHON.
INTRODUCTION TO THE PROJECT.
SYSTEM REQUIREMENTS.
BACKEND DETAILS.
FRONTEND DETAILS.
MOTIVE.
SCREEN SHOTS OF EXECUTION.
LIMITATIONS.
BIBLIOGRAPHY.
INTRODUCTION TO PYTHON

Python is an interpreted, object-oriented, high-


level programming language with dynamic
semantics. Its high-level built in data structures,
combined with dynamic typing and dynamic
binding, make it very attractive for Rapid
Application Development, as well as for use as
a scripting or glue language to connect existing
components together. Python's simple, easy to
learn syntax emphasizes readability and
therefore reduces the cost of program
maintenance. Python supports modules and
packages, which encourages program
modularity and code reuse. The Python
interpreter and the extensive standard library
are available in source or binary form without
charge for all major platforms, and can be freely
distributed.
History of Python

Python is a widely used general-purpose, high-


level programming language. It was initially
designed by Guido van Rossum in 1991 and
developed by Python Software Foundation. It
was mainly developed for emphasis on code
readability, and its syntax allows programmers
to express concepts in fewer lines of code.
INTRODUCTION TO THE PROJECT

A Contact Book application is a digital tool that allows users

to store and manage contact information such as names, phone

numbers, email addresses, and addresses. This project aims to

develop a Contact Book application using appropriate

programming languages and tools. The documentation will

guide you through the process of creating the application from

scratch.
ACKNOWLEDGEMENT

We thank our Computer science Teacher Mrs. Deepika.C for

guidance and support. We are also thankful to our Principal

Mrs. Sri Vidhya Prince. We would also thank our parents for

encouraging us during the course of this project. We would

like to thank CBSE for giving us an opportunity to undertake

this project
SYSTEM REQUIREMENTS

Language/s Used: Python (GUI)


PHP version(recommended) 3.8/3.9
Database: MySQL
BACKEND DETAILS

Database Name: contact

Database Engine: MySQL

Host: localhost

Username: root

Password: 1234

Columns:

1. name (char(30)) - Primary Key

2. address (char(100))

3. mobile (char(15))

4. email (char(30))
FRONTEND DETAILS
PROGRAM CODE
import mysql.connector
import time
db =
mysql.connector.connect(host="localhost",user="root",pass
word="root",database="contact")
cursor = db.cursor()
cursor.execute("""
CREATE TABLE IF NOT EXISTS book (name char(30) primary
key,address char(100),mobile char(15),email char(30));""")
def intro():
print("=" * 80)
print("{:^80s}".format("CONTACT"))
print("{:^80s}".format("BOOK"))
print("{:^80s}".format("PROJECT"))
print("{:^80s}".format("MADE BY: snsacademy.com"))
print("=" * 80)
print()
time.sleep(2)
def create_record():
name = input("Enter name: ")
address = input("Enter address: ")
mobile = input("Enter mobile: ")
email = input("Enter email: ")
sql = "INSERT INTO book(name,address,mobile,email)
VALUES (%s,%s,%s,%s)"
record = (name, address, mobile, email)
cursor.execute(sql, record)
db.commit()
print("Record Entered Successfully\n")
def search(name):
sql = "SELECT * FROM book WHERE name = %s"
value = (name,)
cursor.execute(sql, value)
record = cursor.fetchone()
if record is None:
print("No such record exists")
else:
print('Name:', record[0])
print('Address:', record[1])
print('Mobile:', record[2])
print('E-mail:', record[3])
def display_all():
cursor.execute("SELECT * FROM book")
print('{0:20}{1:30}{2:15}{3:30}'.format('NAME', 'ADDRESS',
'MOBILE NO', 'E-MAIL'))
for record in cursor:
print('{0:20}{1:30}{2:15}{3:30}'.format(record[0],
record[1], record[2], record[3]))
def delete_record(name):
sql = "DELETE FROM book WHERE name = %s"
value = (name,)
cursor.execute(sql, value)
db.commit()
if cursor.rowcount == 0:
print("Record not found")
else:
print("Record deleted successfully")
def modify_record(name):
sql = "SELECT * FROM book WHERE name = %s"
value = (name,)
cursor.execute(sql, value)
record = cursor.fetchone()
if record is None:
print("No such record exists")
else:
while True:
print("\nPress the option you want to edit: ")
print("1. Name")
print("2. Address")
print("3. Mobile")
print("4. BACK")
print()
ch = int(input("Select Your Option (1-4): "))
if ch == 1:
new_name = input("Enter new name: ")
sql = "UPDATE book SET name = %s WHERE name =
%s"
values = (new_name, name)
cursor.execute(sql, values)
db.commit()
print(cursor.rowcount, "record updated
successfully")
elif ch == 2:
new_address = input("Enter new address: ")
sql = "UPDATE book SET address = %s WHERE name
= %s"
values = (new_address, name)
cursor.execute(sql, values)
db.commit()
print(cursor.rowcount, "record updated
successfully")
elif ch == 3:
new_mobile = input("Enter new mobile : ")
sql = "UPDATE book SET mobile = %s WHERE name =
%s"
values = (new_mobile, name)
cursor.execute(sql, values)
db.commit()
print(cursor.rowcount, "record updated
successfully")
elif ch == 4:
break
else:
print("Invalid choice !!!\n")

def main():
intro()
while True:
print("\nMAIN MENU ")
print("1. ADD NEW RECORD")
print("2. SEARCH RECORD")
print("3. DISPLAY ALL RECORDS")
print("4. DELETE RECORD")
print("5. MODIFY RECORD")
print("6. EXIT")
print()
ch = int(input("Select Your Option (1-6): "))
print()
if ch == 1:
print("ADD NEW RECORD")
create_record()
elif ch == 2:
print("SEARCH RECORD BY NAME")
name = input("Enter name: ")
search(name)
elif ch == 3:
print("DISPLAY ALL RECORDS")
display_all()
elif ch == 4:
print("DELETE RECORD")
name = input("Enter name: ")
delete_record(name)
elif ch == 5:
print("MODIFY RECORD")
name = input("Enter name: ")
modify_record(name)
elif ch == 6:
print("Thanks for using Contact Book")
db.close()
break
else:
print("Invalid choice")
main()
MOTIVE
With a contact book, you can store and manage contact

information for your family members, friends, coworkers,

and so on.
SCREEN SHOTS OF EXECUTION
MYSQL Before executing:

MAIN MENU:
Python:
ADDING A NEW RECORD:
Python:

MySQL:
SEARCHING A RECORD :

DISPLAYING ALL RECORDS:


DELETING A RECORD:
Python:

MySQL:
MODIFYING A RECORD:
Python:

Name:
Address:

Mobile:

MySQL:
EXIT:
BIBLIOGRAPHY

BOOKS:

 COMPUTER SCIENCE WITH PYTHON-BY

SUMITA ARORA

 COMPUTER SCIENCE WITH PYTHON-BY

PREETI ARORA

WEBSITES:

 https://docs.python.org/3/

https://docs.python.org/3/library/tkinter.html

https://www.sqlite.org/docs.html
LIMITATIONS

Limited Information: Contact books typically only

include basic information such as name, phone

number, email, and address. They may not

accommodate additional details or preferences that

could be relevant in certain contexts .

Manual Entry: We have to enter the information

manually even if it is in digital form, this can be time

consuming.
CERTIFICATE
This is to certify that Manoj.ND,Sanjeev.G,Juanile
Fernando.J of class XII-A,SNS ACADEMY,
COIMBATORE has successfully completed his/her
project in Computer Science Practical for the AISSCE as
prescribed by CBSE in the year 2024-2025.
ROLL NO:12A-18
12A-28
12A-17
Sign. of Internal Sign. of External

Sign. Of Principal


You might also like