Skip to content

Commit 39e34fb

Browse files
authored
advanced library_mangement_system
1 parent 5f9fc31 commit 39e34fb

File tree

4 files changed

+130
-0
lines changed

4 files changed

+130
-0
lines changed
1.59 MB
Binary file not shown.
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
'''
2+
Author: Aditya Mangal
3+
Date: 16 september,2020
4+
Purpose: python mini project
5+
6+
'''
7+
8+
9+
10+
from win32com.client import Dispatch
11+
12+
class library:
13+
14+
def __init__(self, list, name):
15+
16+
self.book_list = list
17+
self.name = name
18+
self.lend_dict = {}
19+
20+
def display_books(self):
21+
print(f"{self.name} library has: ")
22+
for books in self.book_list:
23+
print(books)
24+
25+
def lend_book(self, user, book):
26+
27+
if book not in self.lend_dict.keys():
28+
self.lend_dict.update({book: user})
29+
print('Database updated . you can now lend the book.')
30+
31+
else:
32+
print(f"the book is already lend by {self.lend_dict[book]}.")
33+
34+
def return_book(self, book):
35+
if book not in self.lend_dict.keys():
36+
print('Not Returnable. Check twice')
37+
else:
38+
self.lend_dict.pop(book)
39+
print('Book returned successfuly.\n')
40+
41+
def add_book(self, book):
42+
self.book_list.append(book)
43+
print('Book added successfully.')
44+
45+
46+
if __name__ == '__main__':
47+
speak = Dispatch("SAPI.spvoice")
48+
speak.speak("Welcome to the Library")
49+
print('\t\t **Welcome to Library** \t\t\n')
50+
51+
obj = library([
52+
'python', 'Let us C', 'C++', 'compiler design', 'java', 'web designing'], 'Aditya Mangal')
53+
54+
while True:
55+
56+
user = int(input(
57+
"what you want you do?\nPress 1 to display the books in the library.\nPress 2 to lend a book from library.\nPress 3 to return a book.(Return the book in given time to ignore late fine)\nPress 4 to add a book.\n"))
58+
59+
if user is 1:
60+
61+
obj.display_books()
62+
63+
elif user is 2:
64+
user_name = input('Enter your name.\n')
65+
user_book = input('Enter the book name u want to lend.\n')
66+
obj.lend_book(user_name, user_book)
67+
68+
elif user is 3:
69+
returning_book = input('Enter the book you want to return.\n')
70+
obj.return_book(returning_book)
71+
72+
elif user is 4:
73+
adding_book = input('Enter the book you want to add.\n')
74+
obj.add_book(adding_book)
75+
76+
else:
77+
print('Something gone wrong! Please check again.')
78+
79+
user_input = int(
80+
input('Want something more?\nPress 1 to continue.\nPress 2 to exit.\n'))
81+
82+
if user_input is 1:
83+
84+
continue
85+
86+
else:
87+
88+
exit()
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# -*- mode: python ; coding: utf-8 -*-
2+
3+
block_cipher = None
4+
5+
6+
a = Analysis(['main.py'],
7+
pathex=['C:\\Users\\Aditya Mangal\\Desktop\\New folder'],
8+
binaries=[],
9+
datas=[],
10+
hiddenimports=[],
11+
hookspath=[],
12+
runtime_hooks=[],
13+
excludes=[],
14+
win_no_prefer_redirects=False,
15+
win_private_assemblies=False,
16+
cipher=block_cipher,
17+
noarchive=False)
18+
pyz = PYZ(a.pure, a.zipped_data,
19+
cipher=block_cipher)
20+
exe = EXE(pyz,
21+
a.scripts,
22+
[],
23+
exclude_binaries=True,
24+
name='main',
25+
debug=False,
26+
bootloader_ignore_signals=False,
27+
strip=False,
28+
upx=True,
29+
console=True )
30+
coll = COLLECT(exe,
31+
a.binaries,
32+
a.zipfiles,
33+
a.datas,
34+
strip=False,
35+
upx=True,
36+
upx_exclude=[],
37+
name='main')
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## Library-Management-System
2+
3+
A Library management system is a software that uses to maintain the record of the library. It contains work like the number of available books in the library, the number of books are issued or returning or renewing a book or late fine charge record.
4+
5+
![library-management-system-python-project](https://user-images.githubusercontent.com/68494604/92790196-2f8d8000-f3c9-11ea-8767-c3746058babb.jpg)

0 commit comments

Comments
 (0)