Professional Documents
Culture Documents
21bee0311 VL2023240504436 Ast05
21bee0311 VL2023240504436 Ast05
Aim: To create an application with an internal GUI using the Kivy library,.
This experiment involves the utilization of the Kivy library to develop a cross-platform mobile or
desktop application, emphasizing an internal graphical user interface (GUI). Kivy, distinguished for
its Python-based framework, facilitates the construction of user-friendly interfaces. The
procedural workflow encompasses meticulous planning, design, and subsequent implementation
phases. Leveraging Python within the Kivy framework, we define and instantiate interactive GUI
elements, such as buttons and sliders. Rigorous testing protocols are applied to ascertain
functional integrity across diverse platforms, with particular attention to addressing potential
compatibility issues. Iterative refinements driven by user feedback aim at optimizing user
satisfaction and interface performance. The experiment concludes with comprehensive
documentation, encapsulating key insights and outcomes, thereby contributing to the ongoing
exploration of Kivy's efficacy in the development of intuitive application interfaces.
Python code:
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
from kivy.uix.image import Image
class childApp(GridLayout):
def __init__(self):
super(childApp, self).__init__()
self.cols=2
self.add_widget(Image(source="C:/Users/IOT/Pictures/child.jpg"))
self.add_widget(Image(source="C:/Users/IOT/Pictures/child.jpg"))
self.add_widget(Label(text="Student Name:"))
self.s_name=TextInput()
self.add_widget(self.s_name)
self.add_widget(Label(text="Reg No:"))
self.s_regno=TextInput()
self.add_widget(self.s_regno)
self.add_widget(Label(text="Department:"))
self.s_Dept=TextInput()
self.add_widget(self.s_Dept)
self.add_widget(Label(text="School:"))
self.s_schl=TextInput()
self.add_widget(self.s_schl)
self.add_widget(Label(text="Year of passing:"))
self.s_year=TextInput()
self.add_widget(self.s_year)
self.press=Button(text='Click')
self.press.bind(on_press=self.click)
self.add_widget(self.press)
def click(self,instance):
f =open("out1.txt",'a')
print("Student Name:" + self.s_name.text,file=f)
print("Reg No:" + self.s_regno.text,file=f)
print("Department:" + self.s_Dept.text,file=f)
print("School:" + self.s_schl.text,file=f)
print("Year of passing:" + self.s_year.text,file=f)
f.close()
class parentApp(App):
def build(self):
return childApp()
if __name__ == "__main__":
app=parentApp()
app.run()