1from kivy.app import App
2from kivy.uix.gridlayout import GridLayout
3from kivy.uix.label import Label
4from kivy.uix.textinput import TextInput
5
6
7class LoginScreen(GridLayout):
8
9 def __init__(self, **kwargs):
10 super(LoginScreen, self).__init__(**kwargs)
11 self.cols = 2
12 self.add_widget(Label(text='User Name'))
13 self.username = TextInput(multiline=False)
14 self.add_widget(self.username)
15 self.add_widget(Label(text='password'))
16 self.password = TextInput(password=True, multiline=False)
17 self.add_widget(self.password)
18
19
20class MyApp(App):
21
22 def build(self):
23 return LoginScreen()
24
25
26if __name__ == '__main__':
27 MyApp().run()
1#-*- coding: utf-8 -*-
2
3from kivy.app import App
4from kivy.uix.label import Label
5
6class TestApp(App):
7 def build(self):
8 return Label(text='Hello World')
9
10TestApp().run()
11
12
1"""
2Kivy is a cross-platform python library for developing apps across many
3devices, including:
4
51. IOS
62. Android
73. Windows
84. Linux
95. MacOS
10
11Even better for developers - It's open source!
12"""
1[Python 3.5 Windows]
2python -m pip install kivy.deps.angle
3python -m pip install kivy
1from kivy.app import App
2from kivy.uix.button import Button
3
4class TestApp(App):
5 def build(self):
6 return Button(text='My Name is Vivek')
7
8TestApp().run()
9