-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathLibraryProject.py
More file actions
84 lines (65 loc) · 3.11 KB
/
Copy pathLibraryProject.py
File metadata and controls
84 lines (65 loc) · 3.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
import projectlibrary
import liberary
class Library():
# This class is used to keep record of books library.
# """ It has total five module: "Display Book", "Search Book", "Add Book ", "Issue Book", "Submmit Book " """
def DisplayBook(self):
print("------------List of Book------------")
print("Book Id", "/t", "Title")
for key, value in self.books_dict.items():
print(key, "/t""/t", value.get("books_title"), value.get("Status"))
# """ IMPORT projectlibrary AND liberary MODULE IN MY PROJECT"""
def Importing(self):
projectlibrary.searchbook(searchbook.book)
print("Well Come to SearchBook Function:")
liberary.addBook(addBook.adbk)
print("Well Come to AddBook Function:")
liberary.addStudent(addStudent.name,addStudent.roll)
print("Well Come to AddStudent Function:")
projectlibrary.showbook(showbook.list,showbook.res)
print("Well Come to SearchBook Function:")
def Issuebook(self):
issue = input("Do you want to take book in the library :")
if issue.lower() == 'yes':
ibook_name = input("Enter the book name: ")
ibook_subject = input("Enter the subject of the book: ")
ibook_author = input("Enter the book author name: ")
ibook_date = datetime.datetime.now()
if books_id in self.books_dict.keys():
if not self.books_dict[books_Id]["Status"] == "Available":
print(f"This book is already Issue to{self.books_dict[book_Id]["Lender_name"]}"\
on {self.books_dict[book_Id][Issue_date]})
return self.Issue_books()
if self.books_dict[books_Id]["Status"] == "Available":
name = input("Enter the your name: ")
self.books_dict[book_Id]["Lender_name"] =name
self.books_dict[book_Id]["Issue_date"] =ibook_date
self.books_dict[book_Id]["Status"] ="Already Issued"
print("---Book Issued Successfull:---")
def Submitbook(self):
sbook_name = input("Enter the book name: ")
sbook_subject = input("Enter the subject of the book: ")
sbook_author = input("Enter the book author name: ")
sbook_date = input("Enter the date of submmit book: ")
obj =digitallibrary()
obj = Library("List_of_books.txt", "Python's Library")
choice = 1
while choice != 0:
print("1. Searchbook")
print("2. Addbook")
print("3. Issuebook")
print("4. Submitbook")
print("5. DisplayBook")
choice = int(input("Enter your choice: "))
if choice == "DisplayBook":
print(obj.DisplayBook())
elif choice == "SearchBook":
print(obj.SearchBook())
elif choice == "Addbook":
print(obj.Addbook())
elif choice == "Issuebook":
print(obj.Issuebook())
elif choice == "Submitbook":
print(obj.Submitbook())
else:
print("Invalid choice")