-
Notifications
You must be signed in to change notification settings - Fork 140
/
College_library_Management_App.py
49 lines (39 loc) · 1.49 KB
/
College_library_Management_App.py
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
import kivy
from kivy.app import App
from kivy.uix.gridlayout import GridLayout
from kivy.uix.label import Label
from kivy.uix.textinput import TextInput
from kivy.uix.button import Button
class LibraryGrid(GridLayout):
def __init__(self, **kwargs):
super(LibraryGrid, self).__init__()
self.cols=4
self.add_widget(Label(text="Student Name : "))
self.a_name = TextInput()
self.add_widget(self.a_name)
self.add_widget(Label(text="Name of Book : "))
self.a_book = TextInput()
self.add_widget(self.a_book)
self.add_widget(Label(text="Issue Date : "))
self.a_issue = TextInput()
self.add_widget(self.a_issue)
self.add_widget(Label(text="Return Date : "))
self.a_return = TextInput()
self.add_widget(self.a_return)
self.add_widget(Label(text="Fine : "))
self.a_fine = TextInput()
self.add_widget(self.a_fine)
self.press = Button(text ="Click here to print Information")
self.press.bind(on_press = self.click_me)
self.add_widget(self.press)
def click_me(self, instance):
print("Name of the Student : " + self.a_name.text)
print("Name of the Book: " + self.a_book.text)
print("Issue Date : " + self.a_issue.text)
print("Return Date : " + self.a_return.text)
print("Fine : " + self.a_fine.text)
class LibraryApp(App):
def build(self):
return LibraryGrid()
if __name__ == '__main__':
LibraryApp().run()