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

CSC Project

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

CSC Project

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

TODOLIST

TABLE OF CONTENTS
1 PROJECT DESCRIPTION
2 GLIMPSES OF PYTHON
3 GLIMPSES OF MYSQL
4 HARDWARE AND SOFTWARE
CONFIGURATION
5 TABLES IN THE DATABASE
6 SOURCE CODE
7 OUTPUT
8 BIBLIOGRAPHY
PROJECT DESCRIPTION

The project “TODOLIST” uses Python as front end and


MySql as backend. It aims to maintain the details of
user’s todolist details in a systematic way.
user details are stored in Mysql table for easy retrieval
and access.

The following functionalities are included in the project:


• Adding user Details
• Display user Details
• Search user Details
• Update user Details
• Delete user Details
GLIMPSES OF PYTHON
• Python is a high-level, general-purpose, self- contained
programming language designed to meet the needs of
computer scientists, software developers and college
students interested in coding.
• Python was created in the early 1980s by Guido van
Rossum.
• Python is a high-level, interpreted, dynamic object-
oriented programming language that can be used to
program applications or web sites.
• It is also known as an object-oriented programming
(OOP) language. The main benefits of using Python
instead of other languages are that it is very easy to
start programming with and because of its flexible
syntax, it can be used to program almost any kind of
software application.
• Python is an open source language that’s free to use
and has a wide range of features that make it easy to
customize.
Python Features and Advantages
• Easy to Code. Python is a very high-level programming
language, yet
it is effortless to learn.
• Easy to Read. Python code looks like simple English
words.
• Free and Open-Source.
• Robust Standard Library.
• Interpreted.
• Portable.
• Object-Oriented and Procedure-Oriented.
• Extensible.
GLIMPSES OF MYSQL
MySQL is a system that helps to store and manage data
efficiently.
Database generally stores data in a structured fashion.

SALIENT FEATURES OF MYSQL


Quick and Reliable
MySQL stores data efficiently in the memory ensuring
that data is consistent, and not redundant. Hence, data
access and manipulation using MySQL is quick.
Free to download
MySQL is free to use so that we can download it from
MySQL official website without any cost.
Scalable
Scalability refers to the ability of systems to work easily
with small amounts of data, large amounts of data,
clusters of machines, and so on. MySQL server was
developed to work with large databases.
Data Types
It contains multiple data types such as unsigned
integers, signed integers, float (FLOAT), double
(DOUBLE), character (CHAR), variable character
(VARCHAR), text, blob, date, time, datetime, timestamp,
year, and so on.
Secure
It provides a secure interface since it has a password
system which is flexible, and ensures that it is verified
based on the host before accessing the database. The
password is encrypted while connecting to the server.

Support for large databases


MySQL has no limit on the number of databases. The
underlying filesystem may have a limit on the number of
directories.MySQL has no limit on thenumber of tables.
The underlying file system may have a limit on the
number of files that represent tables. Individual storage
engines may impose engine-specific constraints. InnoDB
permits up to 4 billion tables.
Client and Utility Programs
MySQL server also comes with many client and utility
programs. This includes Command line programs such as
‘mysqladmin’ and graphical programs such as ‘MySQL
Workbench’. MySQL client programs are written in a
variety of languages. Clientlibrary(codeencapsulated in a
module) can be written in C or C++ and would be
available for clients that have C bindings.
Compatible on many operating systems
MySQL is compatible to run on many operating
systems, like Novell NetWare, Windows* Linux*, many
varieties of UNIX* (such as Sun*Solaris*, AIX, and DEC*
UNIX), OS/2, FreeBSD*, and others. MySQL also provides
a facility that the clients can run on the same computer
as the server or onanother computer (communication
via a local network or the Internet).
GUI Support
MySQL provides a unified visual database graphical user
interface tool
named "MySQL Workbench" to work with database
architects, developers,
and Database Administrators

HARDWARE AND SOFTWARE CONFIGURATION


HARDWARE
• Operating System : Windows 10 or above
• Processor : Pentium 2.6GHz
• RAM : 4GB
• HardDisk : SSD 128GB

SOFTWARE
• Windows OS
• Python 3.12
• MySQL 8.0 Command Line Client
TABLES IN THE
DATABASE
SOURCE CODE
import mysql.connector as ms
mycon=ms.connect(host='localhost',user='root',p
assword='password',database='todolist')
mycursor=mycon.cursor()

def display():
global mycon,mycursor
try:
inpstrquery="select * from useractivity"
mycursor.execute(inpstrquery)
results=mycursor.fetchall()
print("******************************")
print("contents in the table are",results)
print("******************************")
count=0
for row in resuults:
print("no. of resulting row",count)
print("**********TOTAL
RECORD:",MYCURSOR.ROWCOUNT,"**********
")
except:
print("error")

def insert():
global mycon,mycursor
print("inserting uservalues into the
useractivity")
userid=int(input("enter the userid"))
taskno=int(input("enter the tasknumber"))
userid_taskno=int(input("enter the
userid_taskno"))
Gender=(input("enter the gender"))
inpstrquery="insert into todolist values({},{},
{},’{}’)".format(userid,taskno,userid_taskno,gend
er)
mycursor.execute(inpstrquery)
mycon.commit()
print("\nRECORD ADDED SUCCESSFULLY!")

def search():
global mycon,mycursor
print("search userid from useractivity")
userid=int(input("enter the userid to be
searched"))
inpstrquery="select * from useractivity where
userid={}".format(userid)
mycursor.execute(inpstrquery)
results=mycursor.fetchall()
if mycursor.rowcount<=0:
print("\n sorry! no matching details
available")
else:
for row in results:
print("no. of resulting rows")

def update():
global mycon,mycursor
print("updating completionstatus of the user")
userid_taskno=int(input("enter the
newuserid_taskno"))
inpstrquery="select * from useractivity where
userid_taskno={}".format(userid_taskno)
mycursor.execute(inpstrquery)
results=mycursor.fetchall()
if mycursor.rowcount<=0:
print("sorry! no matching details available")
else:
for row in results:
print()
ans=input("are you sure to update?(y/n)")
if ans=="y" or ans=="Y":
newtask=input(“enter the new task”)
newtcompletionstatus=(input("enter the new
completionstatus"))
inpstrquery="update useractivity
completionstatus=’{}’ where
userid_taskno={}".format(userid_taskno)
mycursor.execute(inpstrquery)
mycon.commit()
print("\nRECORD UPDATED")

def delete():
global mycon,mycursor
print("deleting user from the useractivity")
userid_taskno=int(input("enter the
userid_taskno to be deleted"))
inpstrquery="select * from useractivity where
userid_taskno={}".format(userid_taskno)
mycursor.execute(inpstrquery)
results=mycursor.fetchall()
if mycursor.rowcount<=0:
print("\##SORRY!NO MATCHING DETAILS
AVAILABLE##")
else:
for row in results:
print()
ans=input("are you sure to delete?(y/n)")
if ans=="y"or ans=="y":
inpstrquery="delete from useractivitywhere
taskno={}"
mycursor.execute(inpstrquery)
mycon.commit()
print("/n record deleted")

display()
insert()
search()
update()
delete()
mycon.close()
OUTPUT

*******************TODOLIST***********************
1.SHOW USER LIST
2.ADD NEW USER
3.SEARCH USE
4.UPDATE USER
5.DELETE USER
6.EXIT
**************************************************
Enter your choice:2
****************** ADD NEW USER ******************
Enter userid : 103415
Enter taskno : 01
Enter userid_taskno : 10341501
Enter gender: female

RECORD ADDED SUCCESSFULLY!

*********************TODOLIST**********************
1.SHOW USER LIST
2.ADD NEW USER
3.SEARCH USER
4.UPDATE USER
5.DELETE USER
6.EXIT
**************************************************
Enter your choice:1
**************************************************
Userid taskno userid_taskno gender
103813 01 10381301 female
103813 02 10381302 female
103813 03 10381303 female
103813 04 10381304 female
103813 05 10381305 female
103813 06 10381306 female
103813 07 10381307 female

104004 01 10400401 female


104004 02 10400402 female
104004 03 10400403 female
104004 04 10400404 female
104004 05 10400405 female
104004 06 10400406 female
104004 07 10400407 female
103983 01 10398301 female
103983 02 10398302 female
103983 03 10398303 female
103983 04 10398304 female
103983 05 10398305 female
103983 06 10398306 female
103983 07 10398307 female
103415 01 10341401 female
*********************TOTALRECORD :21*****************
**********************TODOLIST***********************
1.SHOW USER LIST
2.ADD NEW USER
3.SEARCH USER
4.UPDATE USER
5.DELETE USER
6.EXIT
****************** ***********************************
Enter your choice:3
***********************SEARCH USER*******************
Enter userid_taskno to search :10341501
Userid taskno userid_taskno gender
103415 01 10341501 female
*******************TODOLIST**************************
1.SHOW USER LIST
2.ADD NEW USER
3.SEARCHUSER
4.UPDATE USER
5.DELETE USER
6.EXIT
****************** **********************************
Enter your choice:4
******************UPDATE USER***********************
Enter the userid_taskno: 10341501
****************************************************
Enter completion status to update :completed
*****************************************************
Userid_taskno task completionstatus
10341501 homework completed
***************************************************
Are you sure you want to update?(y/n)y
Enter new task (enter old value if not to update):
Enter completionstatusto update (enter old value if not to
update): completed
*******************TODOLIST**************************
1.SHOW USER LIST
2.ADD NEW USER
3.SEARCH USER
4.UPDATE USER
5.DELETE USER
6.EXIT
*****************************************************
Enter your choice:5
******************DELETE USER************************
Enter userid_taskno to delete :10341501
*****************************************************
Userid taskno userid_taskno gender
***************************************************
103813 01 10381301 female
103813 02 10381302 female
103813 03 10381303 female
103813 04 10381304 female
103813 05 10381305 female
103813 06 10381306 female
103813 07 10381307 female

104004 01 10400401 female


104004 02 10400402 female
104004 03 10400403 female
104004 04 10400404 female
104004 05 10400405 female
104004 06 10400406 female
104004 07 10400407 female
103983 01 10398301 female
103983 02 10398302 female
103983 03 10398303 female
103983 04 10398304 female
103983 05 10398305 female
103983 06 10398306 female
103983 07 10398307 female
103415 01 10341401 female

Are you sure to delete ?(y/n)y

RECORD DELETED

Enter your choice :6


BIBLIOGRAPHY:

.COMPUTER SCIENCE WITH PYTHON -


SUMITHA ARORA
PREETHI ARORA

You might also like