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

COMPUTER SCIENCE PROJECT FILE (Ayush)

This document contains an acknowledgement and certificate for a student named Ayush Singh Panwar for completing a computer science project on a library management system. The acknowledgement thanks the computer science teacher, parents, and team members for their support in completing the project. The certificate confirms that Ayush Singh Panwar of DLF Public School successfully completed the library management system project for the 2020-2021 session.

Uploaded by

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

COMPUTER SCIENCE PROJECT FILE (Ayush)

This document contains an acknowledgement and certificate for a student named Ayush Singh Panwar for completing a computer science project on a library management system. The acknowledgement thanks the computer science teacher, parents, and team members for their support in completing the project. The certificate confirms that Ayush Singh Panwar of DLF Public School successfully completed the library management system project for the 2020-2021 session.

Uploaded by

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

COMPUTER

SCIENCE PROJECT

Acknowledgement
This report is an outcome of the contribution made by
some of the people. Therefore, its our sole responsibility
to acknowledge them. We all are greatly thankful to the
sincere efforts made by Mrs Ansara Banu , our computer
science teacher who took out their precious time and
made various arrangement for conduction of the classes .
We would also mention the outstanding support given
by our parents who paved the way for me to complete
this project and with all our team members support here
we are with the project.

Warm regards

AYUSH SINGH PANWAR

CERTIFICATE
This is to certify that "AYUSH SINGH PANWAR"
Of Class 12 –E of DLF Public
School has successfully completed the
COMPUTER SCIENCE PROJECT FILE
"LIBRARY MANAGEMENT SYSTEM" for the
Session 2020-2021.

____________________________________ __________________________________

Sign. Of Internal Examiner Sign. Of External Examiner


OUTPUT of main.PY
MAIN.PY
#main start from here user can reg and login using button
from tkinter import *
import os
import datetime
#=======this for accessing all code========
t=Tk()
t.title("Library Management System")
t.geometry("275x200")
t.iconbitmap('images\\logonte.ico')
t.configure(bg="white")
date_f = StringVar()
x = datetime.datetime.now()
y = x.strftime("%d")
z = x.strftime("%B")
a = x.strftime("%Y")
date_f.set("Date:-" + y + '-' + z + '-' + a)
# =======main-frame
main_frame = Frame(t, bd=0, relief=RIDGE, bg="red")
main_frame.place(x=0, y=0, width=275, height=35)
main_frame1 = Frame(t, bd=0, relief=RIDGE, bg="white")
main_frame1.place(x=0, y=40, width=275, height=370)
# =======main-label
main_label = Label(main_frame, text="Library Management System",
font=("Times New Roman", 10, "bold"),
fg="white", bg="red")
main_label.pack()
# =======date on top================
main_date = Label(main_frame, textvariable=date_f, font=("Times
New Roman", 22, "bold"), fg="white",
bg="red")
main_date.place(x=1095, y=10)
title=Label(text="library management")
#======creating buttopn for login=======
def login():
t.destroy()
os.system('Login.py')
def reg():
t.destroy()
os.system('regg.py')
B1=Button(text="login",command=login)
B1.place(x='100',y='60')
B2=Button(text="register",command=reg)
B2.place(x='100',y='100')
t.mainloop()

OUTPUT-
LOGIN.PY
#user can login
from tkinter import *
import datetime
import os
import library
from tkinter import messagebox
import sqlite3
con = sqlite3.Connection("userdatabase")
cur = con.cursor()
class top:
con = sqlite3.Connection("userdatabase")
cur = con.cursor()
def __init__(self,win):
self.prvfrm=None
if(self.prvfrm!=None):
self.prvfrm.destroy()
self.win=win
self.win.title("Library Management System")
self.win.geometry("1278x600")
self.win.iconbitmap('images\\logonte.ico')
self.win.configure(bg="white")
self.date_f=StringVar()
x=datetime.datetime.now()
y=x.strftime("%d")
z=x.strftime("%B")
a=x.strftime("%Y")
self.date_f.set("Date:-"+y+'-'+z+'-'+a)
#=======main-frame=======
self.main_frame=Frame(self.win,bd=0,relief=RIDGE,bg="red")
self.main_frame.place(x=0,y=0,width=1278,height=35)
self.main_frame1=Frame(self.win,bd=0,relief=RIDGE,bg="white")
self.main_frame1.place(x=0,y=40,width=1278,height=670)
#=======main-label=======
self.main_label=Label(self.main_frame,text="Library Management
System",font=("Times New Roman",20,"bold"),fg="white",bg="red")
self.main_label.pack()
#=======main-date=======
self.main_date=Label(self.main_frame,textvariable=self.date_f,font=("Ti
mes New Roman",12,"bold"),fg="white",bg="red")
self.main_date.place(x=1095,y=10)
#=======lms-image=======
self.lms_image=PhotoImage(file="images/library.png")
self.lms_label=Label(self.main_frame1,image=self.lms_image,bg="white")
self.lms_label.image=self.lms_image
self.lms_label.place(x=0,y=35)
#=======username-label=======

self.username_label=Label(self.main_frame1,text="Username:-",font=("T
imes New Roman",12,"bold"),fg="black",bg="white")
self.username_label.place(x=900,y=150)
#=======username-entry=======
self.username_entry=Entry(self.main_frame1,font=("Times New Roman",12))
self.username_entry.place(x=1000,y=150)
#=======password-label=======
self.password_label=Label(self.main_frame1,text="Password:-",font=("Times New
Roman",12,"bold"),fg="black",bg="white")
self.password_label.place(x=900,y=200)
#=======password-entry=======
self.password_entry=Entry(self.main_frame1,font=("Times New
Roman",12),fg="black",show="*")
self.password_entry.place(x=1000,y=200)
#=======login_button=======
self.login_button=Button(self.main_frame1,text="Login",font=(" Times New
Roman",12),bg="white",fg="red",command=lambda:self.login(self.main_f
rame1));
self.login_button.place(x=1050,y=250,width=50,height=30)
#===========to login or start register if user is not
found============
def login(self,prvfrm):
g = self.username_entry.get()
l = self.password_entry.get()
cur.execute("select * from useraccount where username=? and
password=?", (g, l))
tup = cur.fetchone()
try:
if len(g)!=0:
if len(l)!=0:
if len(tup)!=0:
win.destroy()
library.sa()
else:
messagebox.showinfo("fail", 'enter your password')
else:
messagebox.showinfo("fail", 'enter your username ')
except:
messagebox.showinfo("fail", 'user not found, if new user pls sign
up')
def register():
win.destroy()
os.startfile("regg.py")
self.login_button = Button(self.main_frame1, text="register",
font=("Times New Roman", 12), bg="white",
fg="red", command=register);
self.login_button.place(x=1120, y=250, width=50, height=30)
win=Tk()
ob=top(win)
win.mainloop()

OUTPUT-
REG.PY
#user can reg backend database will be created
from tkinter import *
from tkinter import ttk
import os
import datetime
import sqlite3
#for database we use this code
con=sqlite3.Connection("userdatabase")
cur=con.cursor()
cur.execute("create table if not exists useraccount(email
varchar(50),username varchar(20) PRIMARY KEY, dname varchar(20) NOT
NULL ,mob number(10) NOT NULL ,gender varchar(9) NOT
NULL ,password varchar(20) NOT NULL)")
#from PIL import ImageTk,Image
from tkinter import messagebox
class top:
def __init__(self,win):
#---------to make canvas--------
self.prvfrm = None
if (self.prvfrm != None):
self.prvfrm.destroy()
self.win = win
self.win.title("Library Management System") #for title
self.win.geometry("650x550") #fullscreen
self.win.iconbitmap('images\\logonte.ico') #for title bar image
self.win.configure(bg="white") #for canvase color
self.date_f = StringVar() #for date in title bar
x = datetime.datetime.now()
y = x.strftime("%d")
z = x.strftime("%B")
a = x.strftime("%Y")
self.main_frame = Frame(self.win, bd=0, relief=RIDGE, bg="red")
self.main_frame.place(x=0, y=0, width=650, height=35)
self.main_frame1 = Frame(self.win, bd=0, relief=RIDGE, bg="white")
self.main_frame1.place(x=0, y=40, width=650, height=670)
# =======main-label================
self.main_label = Label(self.main_frame, text="Library Management
System", font=("Times New Roman", 20, "bold"),
fg="white", bg="red")
self.main_label.pack()
#-------------to make entry box-----------------
self.date_f.set("Date:-" + y + '-' + z + '-' + a)
self.main_frame3 = Frame(self.win, bd=0, relief=RIDGE, bg="white")
self.main_frame3.place(x=0, y=40, width=478, height=670)
self.id_label = Label(self.main_frame3, text="username",
font=("Times New Roman", 12), fg="black",bg="white")
self.id_label.place(x=5, y=50)
self.id_entry = Entry(self.main_frame3, font=("Times New Roman",
12), fg="black", bg="white")
self.id_entry.place(x=110, y=50)
self.id_label = Label(self.main_frame3, text="username",
font=("Times New Roman", 12), fg="black",
bg="white")
self.id_label.place(x=5, y=50)
self.id_entry = Entry(self.main_frame3, font=("Times New Roman",
12), fg="black", bg="white")
self.id_entry.place(x=110, y=50)
self.name_label = Label(self.main_frame3, text="Name",
font=("Times New Roman", 12), fg="black", bg="white")
self.name_label.place(x=5, y=100)
self.name_entry = Entry(self.main_frame3, font=("Times New
Roman", 12), fg="black", bg="white")
self.name_entry.place(x=110, y=100)
self.email_label = Label(self.main_frame3, text="Email",
font=("Times New Roman", 12), fg="black", bg="white")
self.email_label.place(x=5, y=150)
self.email_entry = Entry(self.main_frame3, font=("Times New
Roman", 12), fg="black", bg="white")
self.email_entry.place(x=110, y=150)
self.mobile_label = Label(self.main_frame3, text="Mobile",
font=("Times New Roman", 12), fg="black", bg="white")
self.mobile_label.place(x=5, y=200)
self.mobile_entry = Entry(self.main_frame3, font=("Times New
Roman", 12), fg="black", bg="white")
self.mobile_entry.place(x=110, y=200)
self.password_label = Label(self.main_frame3, text="pasword",
font=("Times New Roman", 12), fg="black", bg="white")
self.password_label.place(x=5, y=300)
self.password_entry = Entry(self.main_frame3, font=("Times New
Roman", 12), fg="black", bg="white")
self.password_entry.place(x=110, y=300)
self.gender_label = Label(self.main_frame3, text="Gender",
font=("Times New Roman", 12), fg="black", bg="white")
self.gender_label.place(x=5, y=250)
self.gender_combo = ttk.Combobox(self.main_frame3,
values=["Male", "Female", "Other"],
font=("Times New Roman", 12))
self.gender_combo.place(x=110, y=250)
def insert():
#------registration on sqlite3 database----------------
regex = '^[a-z0-9]+[\._]?[a-z0-9]+[@]\w+[.]\w{2,3}$'
reg = '^[a-z0-9]+[\._]?[a-z0-9]'
r=self.email_entry.get()
f=self.gender_combo.get()
t=self.mobile_entry.get()
g=self.id_entry.get()
l=self.password_entry.get()
yh = self.name_entry.get()
#--------to validate entry---------
if (len(r) == 0 or len(f) == 0 or len(t) == 0 or len(g) == 0 or len(l) == 0
or len(yh) == 0):
messagebox.showwarning('Validation Failed', "Fields can't be
empty")
if (re.search(regex,r)):
if t.isdigit() and len(t)==10:
if len(l)>=2:
if yh.isalpha():
a = r + g + yh + t + f + l
cur.execute("insert into useraccount values(?,?,?,?,?,?)",
(r, g, yh, t, f, l))
con.commit()
win.destroy()
messagebox.showinfo("Congratulation!!", 'registraion
susscefull')
os.startfile("Login.py")

else:
messagebox.showinfo("fail", 'use correct name')
else:
messagebox.showinfo("fail", 'use stronger password atleast
longer then 10')
else:
messagebox.showinfo("fail", 'use correct phone no.')
else:
messagebox.showinfo("fail", 'use correct email')
def clear():
r = self.email_entry
f = self.gender_combo
t = self.mobile_entry
g = self.id_entry
l = self.password_entry
yh=self.name_entry
yh.delete(0, 'end')
r.delete(0, 'end')
f.delete(0, 'end')
t.delete(0, 'end')
g.delete(0, 'end')
l.delete(0, 'end')
insert_button = Button(text="Insert", font=("Times New Roman",
12), fg="black",bg="white",command=insert)
insert_button.place(x=130, y=399, width=60, height=30)
reset_button = Button(self.main_frame3,
text="Reset",command=clear, font=("Times New Roman", 12),
fg="black", bg="white")
reset_button.place(x=230, y=359, width=60, height=30)
win=Tk()
ob=top(win)
win.mainloop()
OUTPUT
LIBRARY.PY
#this is library from here u can read or rent a book
from tkinter import *
import os
import book
import sqlite3
import datetime
import os
def sa():
t=Tk()
text=Label(text="library")
prvfrm = None
if (prvfrm != None):
prvfrm.destroy()
t.title("Library Management System")
t.geometry("1275x700")
t.iconbitmap('images\\logonte.ico')
t.configure(bg="white")
date_f = StringVar()
x = datetime.datetime.now()
y = x.strftime("%d")
z = x.strftime("%B")
a = x.strftime("%Y")
date_f.set("Date:-" + y + '-' + z + '-' + a)
# =======main-frame
main_frame = Frame(t, bd=0, relief=RIDGE, bg="red")
main_frame.place(x=0, y=0, width=1278, height=35)
main_frame1 = Frame(t, bd=0, relief=RIDGE, bg="white")
main_frame1.place(x=0, y=40, width=1278, height=670)
# =======main-label
main_label = Label(main_frame, text="Library Management System",
font=("Times New Roman", 20, "bold"),
fg="white", bg="red")
main_label.pack()
# =======main-date
main_date = Label(main_frame, textvariable=date_f, font=("Times New
Roman", 12, "bold"), fg="white",
bg="red")
main_date.place(x=1095, y=10)
text.place()
#========funtion to read pdf delete or place a order
def book1():
t.destroy()
book.sr()
def read():
os.startfile("Encyclopedia of Comic Books and Graphic Novels
( PDFDrive ).pdf")
def read1():
os.startfile("Coraline Graphic Novel ( PDFDrive ).pdf")
def read2():
os.startfile("Survivors - A Novel of the Coming Collapse
( PDFDrive ).pdf")
def read3():
os.startfile("The Essential Rumi by Coleman Barks ( PDFDrive ).pdf")
def read4():
os.startfile("The Gifts of Imperfection_ Embrace Who You Are
( PDFDrive ).pdf")
def read5():
os.startfile("The Year of the Flood_ A Novel ( PDFDrive ).pdf")
def read6():
os.startfile("Then She Was Gone_ A Novel ( PDFDrive ).pdf")
def read7():
os.startfile("The fault in our star.pdf")
#textsection
L10=Label(text='Encyclopedia of Comic Books')
L10.place(x=1,y=100)
L11=Label(text='Coraline Graphic Novel')
L11.place(x=200,y=100)
L12=Label(text='Survivors ')
L12.place(x=400,y=100)
L13=Label(text='The Essential Rumi')
L13.place(x=600,y=100)
L14=Label(text='The Gifts of Imperfection')
L14.place(x=1,y=300)
L15=Label(text='The Year of the Flood')
L15.place(x=200,y=300)
L16=Label(text='Then She Was Gone')
L16.place(x=400,y=300)
L17=Label(text='The fault in our star')
L17.place(x=600,y=300)
#----------book Button----------
b9=Button(text="book",command=book1)
b9.place(x=1,y=150)
b10=Button(text="book",command=book1)
b10.place(x=200,y=150)
b11=Button(text="book",command=book1)
b11.place(x=400,y=150)
b12=Button(text="book",command=book1)
b12.place(x=600,y=150)
b13=Button(text="book",command=book1)
b13.place(x=1,y=360)
b14=Button(text="book",command=book1)
b14.place(x=200,y=360)
b15=Button(text="book",command=book1)
b15.place(x=400,y=360)
b16=Button(text="book",command=book1)
b16.place(x=600,y=360)
#---------read here--------
b91=Button(text="Read",command=read)
b91.place(x=1,y=200)
b101=Button(text="Read",command=read1)
b101.place(x=200,y=200)
b111=Button(text="Read",command=read2)
b111.place(x=400,y=200)
b121=Button(text="Read",command=read3)
b121.place(x=600,y=200)
b131=Button(text="Read",command=read4)
b131.place(x=1,y=400)
b141=Button(text="read",command=read5)
b141.place(x=200,y=400)
b151=Button(text="Read",command=read6)
b151.place(x=400,y=400)
b161=Button(text="Read",command=read7)
b161.place(x=600,y=400)
def rt():
t.destroy()
book.sw()
def rtw():
t.destroy()
book.sdw()
b162 = Button(text="show booking", command=rt)
b162.place(x=300, y=550)
b163 = Button(text="delete booking", command=rtw)
b163.place(x=200, y=550)
t.mainloop()
READ BUTTON output – pdf get open for reading
#this contain code of booking and deleting and seeing ur booking

from tkinter import *

from tkinter import messagebox


import sqlite3

import os

import os.path

import datetime

#----------to make booking-------

con=sqlite3.Connection("Booking")

cur=con.cursor()

#---------sql-lite connectivity ---------------

cur.execute("create table if not exists Booking(username varchar(20),address


varchar(56),mob number(10),qty number(2),Book varchar(50))")

def sr(): #-----------to order-----------

prvfrm = None

if (prvfrm != None):

prvfrm.destroy()

te = Tk()

te.title("Library Management System") # for title

te.geometry("650x550") # fullscreen

te.iconbitmap('images\\logonte.ico') # for title bar image

te.configure(bg="white") # for canvase color

date_f = StringVar() # for date in title ba

x = datetime.datetime.now()

y = x.strftime("%d")
z = x.strftime("%B")

a = x.strftime("%Y")

# -------------to make entry box-----------------

date_f.set("Date:-" + y + '-' + z + '-' + a)

main_frame = Frame(te, bd=0, relief=RIDGE, bg="red")

main_frame.place(x=0, y=0, width=650, height=35)

main_frame1 = Frame(te, bd=0, relief=RIDGE, bg="white")

main_frame1.place(x=0, y=40, width=650, height=670)

# =======main-label

main_label = Label(main_frame, text="Library Management System",


font=("Times New Roman", 20, "bold"),

fg="white", bg="red")

main_label.pack()

L1 = Label(text = "User Name").place(y=50)

E1 = Entry(te)

E1.place(x=65,y=50)

L2 = Label(text="address").place(y=100)

E2 = Entry(te)

E2.place(x=60,y=100)

L3 = Label(text="mob").place(y=150)

E3 = Entry( te)

E3.place(x=60,y=150)
L4 = Label(text="qty number").place(y=200)

E4 = Entry(te)

E4.place(x=80,y=200)

L5 = Label(text="book name").place(y=250)

E5 = Entry(te)

E5.place(x=80,y=250)

def db():

a = (E1.get(), E2.get(), E3.get(),E4.get(),E5.get())

if os.path.isfile(E1.get()):

if os.path.isfile(E5.get()):

cur.execute("insert into Booking values(?,?,?,?,?)", a)

con.commit()

cur.execute("select * from Booking")

a = cur.fetchall()

ab = int(E4.get())

if os.path.isfile(E5.get()):

r=open("d1")

f=r.read().split(":")

cost=int(f[1])

ac = ab * cost

messagebox.showinfo("Congratulation!!", "Your oreder value is %s"


% ac)
print(a)

te.destroy()

os.system("library.py")

else:

messagebox.showinfo("ERROR","we dont have this book in our stock" )

else:

messagebox.showinfo("ERROR","username invalid")

b161=Button(text="confirm booking",command=db)

b161.place(x=200,y=350)

te.mainloop()

def sw():#------------to see your order

prvfrm = None

if (prvfrm != None):

prvfrm.destroy()

te = Tk()

te.title("Library Management System") # for title

te.geometry("650x550") # fullscreen

te.iconbitmap('images\\logonte.ico') # for title bar image

te.configure(bg="white") # for canvase color

date_f = StringVar() # for date in title bar

x = datetime.datetime.now()
y = x.strftime("%d")

z = x.strftime("%B")

a = x.strftime("%Y")

# -------------to make entry box-----------------

date_f.set("Date:-" + y + '-' + z + '-' + a)

main_frame = Frame(te, bd=0, relief=RIDGE, bg="red")

main_frame.place(x=0, y=0, width=650, height=35)

main_frame1 = Frame(te, bd=0, relief=RIDGE, bg="white")

main_frame1.place(x=0, y=40, width=650, height=670)

# =======main-label

main_label = Label(main_frame, text="Library Management System",


font=("Times New Roman", 20, "bold"),

fg="white", bg="red")

main_label.pack()

L1 = Label(text="User Name").place(x=90, y=100)

E1 = Entry(te)

E1.place(x=170, y=100)

def db():

if os.path.isfile(E1.get()):

cur.execute("select * from Booking where username=?", (E1.get(),))

a = cur.fetchall()

if len(a)!=0:
messagebox.showinfo('Find', a)

te.destroy()

os.system("library.py")

else:

messagebox.showinfo("ERROR", "user did not purchase anything form


use")

te.destroy()

os.system("library.py")

else:

messagebox.showinfo("ERROR","username invalid")

b161 = Button(text="search booking", command=db)

b161.place(x=100, y=180)

te.mainloop()

def sdw(): #----------for deleteing booking-----------

prvfrm = None

if (prvfrm != None):

prvfrm.destroy()

te = Tk()

te.title("Library Management System") # for title

te.geometry("650x550") # fullscreen

te.iconbitmap('images\\logonte.ico') # for title bar image


te.configure(bg="white") # for canvase color

date_f = StringVar() # for date in title bar

x = datetime.datetime.now()

y = x.strftime("%d")

z = x.strftime("%B")

a = x.strftime("%Y")

# -------------to make entry box-----------------

date_f.set("Date:-" + y + '-' + z + '-' + a)

main_frame = Frame(te, bd=0, relief=RIDGE, bg="red")

main_frame.place(x=0, y=0, width=650, height=35)

main_frame1 = Frame(te, bd=0, relief=RIDGE, bg="white")

main_frame1.place(x=0, y=40, width=650, height=670)

# =======main-label

main_label = Label(main_frame, text="Library Management System",


font=("Times New Roman", 20, "bold"),

fg="white", bg="red")

main_label.pack()

L1 = Label(text="User Name").place(x=10, y=100)

E1 = Entry(te)

E1.place(x=100, y=100)

L5 = Label(text="book name").place(x=10, y=139)

E5 = Entry(te)
E5.place(x=100, y=139)

def db():

if os.path.isfile(E1.get()):

cur.execute("DELETE from Booking where username=? and Book=?",


(E1.get(),E5.get()))

con.commit()

messagebox.showinfo('Find', " booking deleted")

te.destroy()

os.system("library.py")

else:

messagebox.showinfo("ERROR","username invalid")
b161 = Button(text="Delete booking", command=db)

b161.place(x=300, y=100) te.mainloop()


SHOW BOOKINGS BUTTON output display
booking for a specific user
DELETE BOOKINGS BOTTON output-
Delete a specific booking with 2 condition book name
and username
BOOKINGS AFTER DELETING BOTTON – searching
booking after deleting as we can see the specific
record is deleted for a user
Deleted record –d1, example.pdf(book)
Billography
Computer Science with Python– Sumita Arora
Teacher

You might also like