-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
67 lines (49 loc) · 1.79 KB
/
main.py
File metadata and controls
67 lines (49 loc) · 1.79 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
from addBook import addBook
from adminChecker import adminChecker
from connection import Connection
from removeBook import RemoveBook
from showBooks import showBooks
from updateBook import updateBook
def main():
username = input("Enter your username: ")
password = input("Enter your password: ")
adminCheck = adminChecker(username, password)
adminResult = adminCheck.adminChecker()
print(adminResult)
if adminResult:
while True:
print("Hello admin!!")
print("----------menu----------")
print("[A] Show all books")
print("[B] Add book")
print("[C] Remove book")
print("[D] Update book")
print("[E] Exit")
print("\n")
choice = input("Enter your choice: ")
match choice:
case "A":
show = showBooks().showBookss()
print(show)
case "B":
bookName = input("Enter book name : ")
isbn = input("Enter ISBN : ")
author = input(f"Enter author of {bookName} book: ")
if bookName and isbn and author:
addBook(bookName, isbn, author)
else:
print("Invalid input")
case "C":
isbn = input("Enter ISBN for remove book : ")
RemoveBook(isbn)
case "D":
isbn = input("Enter ISBN for update book : ")
updateBook(isbn)
case "E":
print("Programme terminated!!")
break
case __:
print("Invalid choice")
break
if __name__ == "__main__":
main()