0% found this document useful (0 votes)
32 views6 pages

Project Work

THIS IS PYTHON PROGRAM FOR LIBRARY MANAGEMENT

Uploaded by

Samiksha Sinha
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)
32 views6 pages

Project Work

THIS IS PYTHON PROGRAM FOR LIBRARY MANAGEMENT

Uploaded by

Samiksha Sinha
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/ 6

 PROJECT WORK

 PROGRAM=LIBRARY
Formatted Table

MANAGEMENT
import os
Pimport pickle
import time
width = "150"
height = "50"
os.system("mode con cols="+width+"lines="+height)
######ADD CODE FOR SPECIAL EFFECTS
##
##os.system('COLOR F0')
##
#####end

j=["L","I","B","R","A","R","Y"," "]
for c in range(0,8):
print "\n"*30
for k in range(0,c):

print " "*5, j[k],

print "\n"*20

time.sleep(0.2)
print
#print "\n"*50
#LOGO
c=0
while True:
c+=1
print "*"*4,
if c>4:
print "*"*4,
if c<=2:
print " "*10,
print "*"*15,
if c>2 and c<=4:
print " "*18,
print "*"*5,
if c>4 and c<5:
print " "*11,
print "*"*5,
if c>=5:
print " "*3,
print "*"*15,
if c<3 or c>4:
print " "*5,
print "*"*3,
if c>=3 and c<5:
print " "*12,
print "*"*3,
if c==4 or c==6 :
print "*"*5,
if c==5 :
print " "*2,
print "*"*3,
if c==5:
print " "*4,
print "2.0.1.1",

print
if c>5:

break

#Programming Project Starts Here

class lib:
def __init__(self):
self.act=0
self.bname=" "
self.code=0

def intro(self):
print "#Lib 2.0 "
print "#Following can be done: "
print "#1}Borrow","\n","#2}Return"
print "#3}Available Books","\n","#4}Borrowers List"
print "#5}Book Stat"
print "#6}Add new books to Lib"
print "#}Press Enter to exit..."
def add(self):
self.bname=raw_input("Enter book Name: ")
self.code=input("Enter Code of book:")
def register(self):
self.name=raw_input("Name of borrower:")
self.bookname=raw_input("Enter the name of Book:")
self.code=input("Enter the book code:")
self.date=time.time()
def stat(self):
print "Bookname","\t","Code","\n", self.bookname,"\t"*2,
print self.code
#print "Book status changed To:UnAvailable...."

def outdel(self):
print "Name","\t","Bookname","\t","Code","\t"
#print self.name,"\t"*2 , self.bookname,"\t"*2,self.code,"\t"#,self.date
def show(self):
print "Bookname","\t","Code"
print self.bname,"\t",self.code
def bshow(self):
print "Name","\t","Bookname","\t","Code"
print self.name,self.bookname,self.code ##self.date()
def delrec(self,n):
if self.name==n:
self.outdel()
return 1
else:
return 0
def outdelstat(self):
print "Book Status:Available Again" ,self.code
def delstat(self,n):
if self.code==n:
return 1
else:
m=self.code
self.outdelstat()
return 0

x=lib()
x.intro()
print "\n"*20
while True:
act=raw_input("Your choice:")
if act=="1":
#Code To open book list
print"Here is the List of All Available books"

op=open("list.dat","r")
try:
while True:
x=pickle.load(op)
x.show()
except EOFError:
print "Thats all for now..."
print "::"*90
op.close()
#Now For opting to borrow one
x.register()
bl=open("borrowlist.dat","ab")
pickle.dump(x,bl)
bl.close()
x.stat()
bs=open("bookstat.dat","ab")
pickle.dump(x,bs)
bs.close()
elif act=="2":
##########Return()
##Delete function
bl=open("borrowlist.dat","rb")
temp=open("temp","wb")
n=raw_input("enter the name for Returning:")

try:
while True:
x=pickle.load(bl)
m=x.code
if x.delrec(n)==0:
pickle.dump(x,temp)

else:
k=m
#pass
except EOFError:

print "k..."
print "::"*90
bl.close()
temp.close()
os.remove("borrowlist.dat")
os.rename("temp","borrowlist.dat")
#Function to remove book

bs=open("bookstat.dat","rb")
temp=open("temp","wb")
#m=x.code
try:
while True:
x=pickle.load(bs)
if x.delstat(k)==0:
pickle.dump(x,temp)
except EOFError:
print "Removed if in the database Else ignored ....."
print "::"*90
bs.close()
temp.close()
os.remove("bookstat.dat")
os.rename("temp","bookstat.dat")

elif act=="3":
#x.Av_books()

op=open("list.dat","r")
try:
while True:
x=pickle.load(op)
x.show()
except EOFError:
print "Thats all for now..."
print "::"*90
elif act=="4":
#borrowlist()3
bop=open("borrowlist.dat","rb")
try:
while True:
x=pickle.load(bop)
x.bshow()
except EOFError:
print "Thats all for now..."
print "::"*90
bop.close()

elif act=="5":
#x.bookstat()
bstat=open("bookstat.dat","rb")
try:
while True:
x=pickle.load(bstat)
x.stat()
except EOFError:
print "Thats all for now..."
print "::"*90
bstat.close()

elif act=="6":
#adding Books

x=lib()
wpf=open("list.dat","ab")
while True:
x.add()
pickle.dump(x,wpf)
ans=raw_input("any more?")
if ans!="y":
wpf.close()
break

else:
print "\n"*50
k=[" "*10,"T","h","a","n","k","s"," "," "*20,"for "," "*20," ","C ","o","m","i","n","g"]
for c in range(0,18):
print k[c],
time.sleep(0.25)
print
#print "\t"*5,"Thanks for coming"
k=[u"\u00a9","r","e","s","e","r","v","e","d",]
for c in range(0,9):
print k[c],
time.sleep(0.25)
print
k=["c","o","d","e"," "*20,"by"," "*20,"V.Inc"]
for c in range(0,8):
print k[c],
time.sleep(0.25)
break

naveentech907 commented on Feb 3


hi
can you help me with this project i'm 12th now i have a project in 2 days

naveentech907 commented on Feb 3


please email me

naveentech907 commented on Feb 3


[email protected]

OwnerAuthor

versatileVasu commented on Mar 28


hi
can you help me with this project i'm 12th now i have a project in 2 days

Looks like I'm Late , Hope everything has gone well enough , I know it's late but you could have asked your teacher and spoofed like my codes not
working help ! Would have worked . Anyways Thanks for dropping by !
Sorry for the delay (Would be active again by May 27th 2019)

Arzivall-boop commented on Aug 23


Hi Vasu, I saw your Library project it was pretty good at the time when you were a high school student. It seems you haven't provided the list.dat and
other data files. That's okay I'll be creating those on my own, can you recommend some other projects for current class 12 student as you were once
a student yourself? :)

OwnerAuthor

versatileVasu commented on Aug 24


Thanks for getting back to me , it was about 2 years ago when it was to be made so I don't know what the current scenario is but can say for sure it
will be pretty same so being straight to the answer I would say if you are a teacher or a student then anyway the target is to utilize the Max of the
topics so for that we can do many things like : 1)Air traffic control using stacks and queue (If you can think it like where a list of planes and then at
after certain passenger goes to one plane a next plane should be ready or just like that ) 2)Basic Train management /Hotel 3) An ISP like Airtel or Jio
or Vodafone where one retrieves the date of the recharge and after seeing the pack expiry date one recharges and one space for knowing where one
should look for expiry date of pack 4)Old projects like :School grade management etc 5)Why not imagine something from around you ?There must
be alot of things you can do there as you may have plenty of things to look around for ex Toll booth where one give toll tax on highway , medical
shop , e commerse website with limited abilities There's no end but be sure to keep in mind there's limit to number of lines one can care about with
that level of knowledge so being that said utilize as minimum as possible so that it can be easy to refer Short code and minimum number of lines are
different things. Best Vasu Soni

Arzivall-boop commented on Sep 18


Hey, sorry it's wierd that I didn't see your message. I completed my project it was pygame using tkinter, and did a few other management systems.
Anyway thanks for taking the time out to reply me. I'm in the middle of exams right now. So I'd glad if you could mention some things you knew
when you were in class 12. Some different strategies to approach exams. Thanks again :) On Sat 24 Aug, 2019, 2:22 AM Versatile Vasu,
<[email protected]> wrote:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
 © 2019 GitHub, Inc.
 Terms
 Privacy
 Security
 Status
 Help

 Contact GitHub
 Pricing

 API
 Training
 Blog
 About

You might also like