Skip to content

Instantly share code, notes, and snippets.

View kaustubhgupta's full-sized avatar
🏘️
On vacation

Kaustubh Gupta kaustubhgupta

🏘️
On vacation
View GitHub Profile
from kivy.app import App
from kivy.uix.label import Label
class Main(App):
def build(self):
return Label(text='Hello World')
Main().run()
from kivy.app import App
from kivy.uix.button import Button
class Main(App):
def build(self):
return Button(text='Hello World',
size_hint=(0.5, 0.5))
from kivy.app import App
from kivy.metrics import dp
from kivy.uix.behaviors import TouchRippleBehavior
from kivy.uix.button import Button
from kivy.lang import Builder
KV = """
<RectangleFlatButton>:
from kivymd.app import MDApp
from kivymd.uix.button import MDRectangleFlatButton
from kivymd.uix.screen import MDScreen
class Main(MDApp):
def build(self):
screen = MDScreen()
btn = MDRectangleFlatButton(text="Hello World",
pos_hint={'center_x': 0.5, 'center_y': 0.5}
from kivymd.app import MDApp
from kivy.lang import Builder
class Main(MDApp):
def build(self):
return Builder.load_file("label.kv")
Main().run()
Screen:
MDLabel:
text: "[b]Thanks for reading my Medium article![/b]"
halign: "center"
font_style: "H4"
markup: True
from kivymd.app import MDApp
from kivymd.uix.screen import Screen
from kivymd.uix.label import MDLabel
class Main(MDApp):
def build(self):
screen = Screen()
label = MDLabel(text="[b]Thanks for reading my Medium article![/b]",
halign='center',
from kivymd.app import MDApp
from kivy.lang import Builder
kv = """
Screen:
MDLabel:
text: ""
id: txt
pos_hint: {'center_x': 0.5, 'center_y': 0.6}
MDRaisedButton:
from kivymd.app import MDApp
from kivy.lang import Builder
kv = """
Screen:
MDTextField:
hint_text: 'Enter you password'
helper_text: 'Forgot your password?'
helper_text_mode: "on_focus"
pos_hint: {'center_x': 0.5, 'center_y': 0.5}
from kivymd.app import MDApp
from kivy.lang import Builder
from kivy.properties import ObjectProperty
kv = """
Screen:
in_class: text
MDLabel:
text: 'Basic Authentication App'
font_style: 'H2'