b = catalog.addBook('Moonwalking with Einstien', 'J Foer', '2017', 318) catalog.addBookItem(b, '463hg', 'K1B2') b = catalog.addBook('Pax', 'Sara Pennypacker', '2017', 288) catalog.addBookItem(b, '554jk', 'M24A') catalog.addBookItem(b, '556jk', 'M25A') catalog.addBookItem(b, '557jk', 'M26A') catalog.displayAllBooks() catalog.removeBook('Pax') catalog.displayAllBooks() catalog.removeBookItem('Shoe Dog', '124hg') catalog.displayAllBooks() b = catalog.searchByName('Shoe Dog') print(b) b = catalog.searchByAuthor('J Foer') print(b) #member m1 = Member("Vish", "Bangalore", 23, 'asljlkj22', 'std1233') m1.availableBooks(catalog) print(m1) m1.issueBook('Moonwalking with Einstien', catalog) m1.returnBook('Moonwalking with Einstien', catalog)
librarian.removeBookItemFromCatalog("125hg") librarian.displayAllBooks() librarian.removeBook("Shoe Dog") librarian.displayAllBooks() librarian.addBook('Shoe Dog', 'Phil Knight', '2015', 312) librarian.addBookItem("Shoe Dog", '123hg', 'H1B2') librarian.addBookItem("Shoe Dog", '124hg', 'H1B4') librarian.addBookItem("Shoe Dog", '125hg', 'H1B5') librarian.displayAllBooks() librarian.searchBook() print("\n\n") print("Testing Student and its functions:", "\n") m1 = Member("Vish", "Bangalore", 23, 'asljlkj22', 'std1233') print(m1) m1.issueBook("Moonwalking with Einstien", 5) m1.books_issued m1.displayAllBooks() m1.returnBook("466hg") m1.books_issued m1.displayAllBooks() librarian.viewMembers() m2 = Member("Aditya", "Delhi", 21, 'dkbcwibwei23', 'std1234') print(m2) m2.issueBook("Shoe Dog") m2.books_issued m2.returnBook("123hg") m2.books_issued m2.searchBook() librarian.viewMembers()
librarian.addBookItem(book2, '202hg', 'H1B2') librarian.addBookItem(book3, '301hg', 'H1C1') librarian.addBookItem(book3, '302hg', 'H1C2') # librarian.removeBookFromCatalog('A novel') # librarian.removeBookItem('A novel', '102hg') librarian.displayAllBooks() member1 = Member("Ashish", "Bangalore", 23, 'asljlkj22', 'std1233') # print(member1.searchByAuthor('J Foer')) # member1.displayAllBooks() member1.issueBook('A novel') member1.issueBook('Moonwalking with Einstien') # member1.issueBook('Moonwalking with Einstien') member1.issueBook('I heard you paint houses') librarian.displayAllBooks() member2 = Member('Abhinov', "Dharamshala", 19, '231514514', 'std232') member2.issueBook('A novel') member2.issueBook('Moonwalking with Einstien') member3 = Member('Sunita', "Kangra", 27, '8722246464', 'std242') member3.issueBook('A novel') member3.issueBook('I heard you paint houses') librarian.displayAllBooks()
catalog.removeBookItem('Shoe Dog', '124hg') catalog.displayAllBooks() # serching a book b = catalog.searchByName('Shoe Dog') print(b) #librarian object librarian = Librarian("Awantik", "Bangalore", 34, 'asljlkj22', 'zeke101') # librarian adding book l = librarian.addBook(catalog, 'How to write clean code', 'David', '2020', 150) l1 = Book('How to write clean code', 'David', '2020', 150) # librarian adding book items librarian.addBookItem(l, '1234hg', 'H1B2') librarian.addBookItem(l, '1235hg', 'H1B2') catalog.displayAllBooks() # librarian removing bookitem we need to paas class object for calling class methods librarian.removeBookItemFromCatalog(catalog, l1, 'How to write clean code', '1234hg') # librarian removing book librarian.removeBook(catalog, 'Shoe Dog') # memeber Object m1 = Member("Vish", "Bangalore", 23, 'asljlkj22', 'std1233') # member is issuing book and then system will update our inventory m1.issueBook(catalog, b1, 'Shoe Dog') catalog.displayAllBooks() # when member returns a book,then system will update our inventory m1.returnBook(catalog, b1, 'Shoe Dog') catalog.displayAllBooks()
lib.displayAllBooks() lib.addBook('Python','reema thareja', "200",320) lib.addBookItem("Python", "isbn7", "H1D1") lib.addBookItem("Python", "isbn9", "H1D2") lib.displayAllBooks() lib.removeBook("Python") lib.displayAllBooks() lib.removeBookItemFromCatalog("isbn1") lib.displayAllBooks() m1 = Member("Sharma", "Ap", 20, "AA990", "STUID112") print(m1) m1.searchByName("Shoe Dog") m1.searchByAuthor('imran khan') m1.displayAllBooks() m1.issueBook("Progrmming", "isbn4") m1.displayAllBooks() m1.returnBook("Progrmming", "isbn4","H1C1") m1.displayAllBooks()
m1 = Member("Vish", "Bangalore", 23, 'asljlkj22', 'std1233') m2 = Member("Chaitali", "Pune", 28, 'chaitali123', 'HS1166') m3 = Member("Jane", "Punr", 25, 'jane123', 'HS1177') librarian = Librarian("Awantik", "Bangalore", 34, 'asljlkj22', 'zeke101') print(m1) print(librarian) #m1.issueBook librarian = Librarian("Awantik", "Bangalore", 34, 'asljlkj22', 'zeke101') lib1 = librarian.addBook('Lean In', 'Sheryl Sandberg', 2018, 600) catalog.addBookItem(lib1, '454hs', 'H1B6') catalog.addBookItem(lib1, '456hs', 'H1B7') lib2 = librarian.addBook('Harry Potter', 'J.K.Rowling', 2013, 600) catalog.addBookItem(lib2, '545hs', 'H2B1') catalog.addBookItem(lib2, '656hs', 'H2B2') librarian.removeBook('Harry Potter') Catalog.books = [] Catalog.diff_count = 0 m1.issueBook('Lean In') m2.issueBook('Lean In') m1.returnBook('Lean In') catalog.displayLibrarianDetails()
from Book import Book from Catalog import Catalog from User import User from User import Member, Librarian c = Catalog() b1 = c.addBook('Politics of Opportunism','R P N Singh', '2019',100) c.addBookItem(b1,'isbn1','R1') c.addBookItem(b1,'isbn1-2','R1-2') b2 = c.addBook('Malayalam poetry','Akkitham Achuthan Namboodri', '2019',130) c.addBookItem(b2,'isbn2','R2') b3 = c.addBook('Celestial Bodies','Jokha Alharthi', '2019',140) c.addBookItem(b3,'isbn3','R3') m = Member('member1','bangalore',24,'123412341234',25,c) bi1 = m.issueBook('Politics of Opportunism') bi2 = m.issueBook('Politics of Opportunism') m.returnBook(bi1) bi3 = m.issueBook('Politics of Opportunism') bi4 = m.issueBook('Politics of Opportunism')
print("##################") print("user operations") print("##################") member = Member('sagar', 'jaipur', 21, 344564, 33033) print(member) # member.searchCatalogByName(catalog,'2 states') # member.searchCatalogByAuthor(catalog,'Chetan Bhagat') # print(member.showInventory(catalog)) librarian.displayDifferentBooks(catalog) librarian.displayAllBookItems(catalog) rinfo1 = member.issueBook(catalog, '2 states', '#2287') rinfo2 = member.issueBook(catalog, '2 states', '#2284') librarian.displayDifferentBooks(catalog) librarian.displayAllBookItems(catalog) # print(rinfo1) print(member.bookIssued) # librarian.displayAllBookItems(catalog) # librarian.displayDifferentBooks(catalog) print("-----------------------------------------------------") member.returnBook(catalog, '2 states', rinfo1, 10, 21) #rinfo1 contains all info of issued book print("-----------------------------------------------------")
lib.addBook('Shoe Dog', 'Phil Knight', "2015", 312) lib.addBookItem("Shoe Dog", "123pk", "H1B1") lib.addBook('Iron Man', 'Tony Stark', "2001", 800) lib.addBookItem("Iron Man", "123im", "I1B1") lib.addBook('Moonwalking with Einstien', 'J Foer', "2017", 318) lib.addBookItem("Moonwalking with Einstien", "325ad", "A1B1") lib.addBookItem("Moonwalking with Einstien", "326ad", "A1B2") lib.addBook('Harry Potter', 'J K Rowling', "1997", "312") lib.addBookItem("Harry Potter", "854hm", "C1B1") lib.displayAllBooks() lib.removeBookItemFromCatalog("325ad") lib.displayAllBooks() lib.removeBook("Moonwalking with Einstien") lib.displayAllBooks() member1 = Member("Ron", "Pune", 21, "LID547895", "STU343231") member2 = Member("Rhea", "Kerala", 20, "LID43218", "STU656461") member2.searchByName("Shoe Dog") member1.searchByAuthor("Steve") member1.searchByAuthor("Tony Stark") member1.issueBook("Shoe Dog", "123pk") lib.displayAllBooks() member1.returnBook("Shoe Dog", "123pk", "H1B1") lib.displayAllBooks() lib.displayMembers()
book = lib1.addBook("ironman","jhon",2005,300) lib1.addBookItem(book,"125zgc10","g101") lib1.addBookItem(book,"125zgc11","g102") lib1.addBookItem(book,"125zgc12","g103") lib1.addBookItem(book,"125zgc13","g104") book = lib1.addBook("attitude","xyz",2016,350) lib1.addBookItem(book,"765zgc10","h101") lib1.addBookItem(book,"765zgc12","s102") lib1.displayBooks()#displaying the inventory print("\n\n") #issuing the books user1.issueBook("ironman") user2.issueBook("attitude") user1.issueBook("harry potter") print("books inventory after issued by members") lib1.displayBooks() print("\n\n") #returning the books print("books inventry after returning the books by user1 and user2") user1.returnBook("harry potter") user2.returnBook("attitude") lib1.displayBooks()
#b1.addBookItem('123hg','H1B2') #b1.addBookItem('124hg','H1B3') #b1.printBook() catalog = Catalog() b = catalog.addBook('Shoe Dog', 'Phil Knight', '2015', 312) catalog.addBookItem(b, '123hg', 'H1B2') catalog.addBookItem(b, '123hg', 'H1B4') catalog.addBookItem(b, '123hg', 'H1B5') b = catalog.addBook('Moonwalking with Einstien', 'J Foer', '2017', 318) catalog.addBookItem(b, '463hg', 'K1B2') catalog.displayAllBooks() m1 = Member("Vish", "Bangalore", 23, 'asljlkj22', 'std1233') m2 = Member("Anshu", "Lucknow", 26, 'asljlkj19', 'std1210') librarian = Librarian("Awantik", "Bangalore", 34, 'asljlkj22', 'zeke101') print(m1) print(librarian) print(m2) res = m1.issueBook('Shoe Dog', catalog, days=10) print(res) res = m1.returnBook("Shoe Dog") print(res)
b1.printBook() catalog = Catalog() b = catalog.addBook('Shoe Dog','Phil Knight', '2015',312) catalog.addBookItem(b, '123hg','H1B2') catalog.addBookItem(b, '123hg','H1B4') catalog.addBookItem(b, '123hg','H1B5') b = catalog.addBook('Moonwalking with Einstien','J Foer', '2017',318) catalog.addBookItem(b, '463hg','K1B2') catalog.displayAllBooks() m1 = Member("Vish","Bangalore",23,'asljlkj22','std1233') m1.issueBook('Shoe Dog','123hg') catalog.displayAllBooks() m1.returnBook('Shoe Dog','123hg','H1B2') librarian = Librarian("Awantik","Bangalore",34,'asljlkj22','zeke101') librarian.addBook('Shoe Dog','Phil Knight', '2015',312) # librarian.removeBook('Shoe Dog') # librarian.removeBookItemFromCatalog(b,'123hg') print (m1) print (librarian) b = catalog.searchByName('Shoe Dog') print (b) catalog.removeBookItem('Shoe Dog','124hg') catalog.displayAllBooks()