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

CS File

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

CS File

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Delhi Public School

Indira Nagar, Lucknow

PROJECT FILE
To-Do List Using python and MySQL

Project in Computer Science (083)


Subject Teacher: Ms. Pinkie Srivastava

Name: Arish Mukarram Khan


Class: XII
Section: B
Session: 2024-2025
Group Members: Arish Mukarram Khan , Hamza Mumtaz and Murtaza Siddiqui
CERTIFICATE

This is to certify that Master Arish Mukarram Khan

Roll no ________________________________________ class XII B studying in

Delhi Public School, Indira Nagar, Lucknow, has satisfactorily completed the PROJECT

titled To-Do List using Python and MySQL

as a part of course completion in pursuance of AISSCE (Class XII) practical examination

in subject Computer Science (083)

as per the guidelines issued by the CBSE.

The project has been executed by him/her under the guidance of

Ms. Pinkie Srivastava

Signature of the Signature of the Signature of the


Internal Examiner External Examiner Principal
Acknowledgement:

I am immensely grateful for the opportunity to present this project on creating a To-Do List application
using Python and MySQL. This project has been a significant learning experience, and I would like to
express my sincere appreciation to everyone who contributed to its successful completion.

First and foremost, I would like to extend my heartfelt gratitude to my project advisor, Mrs.Pinkie
Srivastava, for their continuous guidance, patience, and support throughout the duration of this project.
Their expertise and encouragement played a pivotal role in shaping the direction and quality of the
work presented here. Their constructive feedback and insightful suggestions helped me overcome
numerous challenges and enhanced my understanding of both Python programming and database
management with MySQL.

I would also like to thank Delhi Public School,Indiranagar for providing me with the necessary
resources and facilities that enabled me to work effectively on this project. The access to relevant
software, hardware, and academic materials was instrumental in bringing this project to fruition.

Furthermore, I would like to acknowledge the contributions of my classmates and peers, whose
discussions and collaborative spirit enriched my learning experience. Their willingness to share
knowledge and exchange ideas was invaluable during the development phases of this project.

My deepest appreciation also goes to my family, whose unwavering support and understanding have
been my constant source of strength. They have always been there to encourage me during the
challenging moments, and their belief in my abilities has been a motivating force throughout this
journey.

In addition, I would like to recognize the contributions of the open-source community and the
developers behind the Python and MySQL libraries. The comprehensive documentation, forums, and
online resources provided by this community were indispensable in overcoming technical challenges
and refining the functionality of the To-Do List application.

I also want to extend my gratitude to the numerous online tutorials, blogs, and educational platforms
that provided guidance and inspiration during the project. The wealth of information available online
greatly facilitated the learning process and allowed me to explore various programming techniques and
database management strategies.

Finally, I am thankful to all those who directly or indirectly supported me in the completion of this
project. This experience has been incredibly rewarding, and I am confident that the knowledge and
skills I have gained will serve me well in my future endeavors.

Thank you.

Arish Mukarram Khan


About Project

The To-Do List application is a command-line based tool developed using Python and MySQL. Its primary function
is to help users manage tasks efficiently by allowing them to create, view, update, and delete tasks through a simple
command-line interface.

Project Objectives

• Task Management: Users can manage tasks by adding, viewing, updating, and deleting them, with all data
stored persistently in a MySQL database.
• Command-Line Interface: The application is entirely CLI-based, offering a lightweight and efficient way to
interact with the task management system.
• Database Integration: MySQL is used to store and manage task data, ensuring data persistence across
sessions.

Technologies Used

• Python: For application logic and database interactions.


• MySQL: For task data storage and management.
• CLI: For user interaction without a graphical interface.

Features

• Add, View, Update, Delete Tasks: Users manage tasks directly from the command line.
• Search and Filter: Allows filtering tasks by criteria like deadlines and priority.

Challenges and Learning Outcomes

The project enhanced my skills in Python programming, database management with MySQL, and command-line
application development. It provided valuable experience in creating a robust and user-friendly non-GUI application.

Conclusion

This project showcases the integration of Python and MySQL in a command-line environment, delivering a practical
tool for task management. The experience gained is foundational for future software development projects, especially
in backend and database-driven applications.
Coding:

import mysql.connector

# MySQL database connection settings


config = {
'user': 'your_username',
'password': 'your_password',
'host': 'your_host',
'database': 'your_database',
}

# Establish a connection to the database


cnx = mysql.connector.connect(**config)

# Create a cursor object to execute SQL queries


cursor = cnx.cursor()

# Create the tasks table if it doesn't exist


cursor.execute("""
CREATE TABLE IF NOT EXISTS tasks (
id INT AUTO_INCREMENT,
task VARCHAR(255),
PRIMARY KEY (id)
);
""")

def add_task():
task = input("Enter task: ")
query = "INSERT INTO tasks (task) VALUES (%s)"
cursor.execute(query, (task,))
cnx.commit()
print("Task added successfully!")

def view_tasks():
query = "SELECT * FROM tasks"
cursor.execute(query)
tasks = cursor.fetchall()
if not tasks:
print("No tasks available.")
else:
for task in tasks:
print(f"{task[0]}. {task[1]}")

def delete_task():
if not view_tasks():
print("No tasks available.")
else:
task_id = int(input("Enter task number to delete: "))
query = "DELETE FROM tasks WHERE id = %s"
cursor.execute(query, (task_id,))
cnx.commit()
print("Task deleted successfully!")

def main():
while True:
def main():
while True:
print("\n--- To-Do List ---")
print("1. Add Task")
print("2. View Tasks")
print("3. Delete Task")
print("4. Exit")
choice = input("Choose an option: ")
if choice == "1":
add_task()
elif choice == "2":
view_tasks()
elif choice == "3":
delete_task()
elif choice == "4":
print("Goodbye!")
break
else:
print("Invalid choice. Please try again.")

if __name__ == "__main__":
main()
Commands:

--- To-Do List ---


1. Add Task
2. View Tasks
3. Delete Task
4. Exit
Choose an option: 1
Enter task: Buy groceries
Task added successfully!

--- To-Do List ---


1. Add Task
2. View Tasks
3. Delete Task
4. Exit
Choose an option: 2
1. Buy groceries

--- To-Do List ---


1. Add Task
2. View Tasks
3. Delete Task
4. Exit
Choose an option: 3
1. Buy groceries
Enter task number to delete: 1
Task deleted successfully!
Output:

1. After Adding the Task

2. After deleting the task


Bibliography:

• Python Software Foundation. "Python Documentation." Python.org, Python Software Foundation,


https://docs.python.org/3/..
• MySQL Documentation. "MySQL Reference Manual." MySQL.com, Oracle Corporation,
https://dev.mysql.com/doc/.
• MySQL. MySQL Community Server 8.0, Oracle Corporation, 2024.
https://dev.mysql.com/downloads/mysql/.
• Python. Python 3.11.4, Python Software Foundation, 2024.
https://www.python.org/downloads/..

You might also like