Advertisement
here2share

# Kivy_basic_2.py

Mar 17th, 2021
961
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.70 KB | None | 0 0
  1. from kivy.app import App
  2. from kivy.uix.gridlayout import GridLayout
  3. from kivy.uix.label import Label
  4. from kivy.uix.textinput import TextInput
  5.  
  6.  
  7. class 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.  
  20. class MyApp(App):
  21.  
  22.     def build(self):
  23.         return LoginScreen()
  24.  
  25.  
  26. if __name__ == '__main__':
  27.     MyApp().run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement