CREATING A HELLO WORLD PROGRAM IN KIVYMD
Link of Video on You tube :- https://youtu.be/EivVLZ6A-Ac
Following are the steps that are required to create hello world program in kivymd
1. Creating the App by importing the MDApp class of kivymd module
2. Creating the Screen by using MDScreen class of kivymd module
3. Printing the hello world text by using the MDLabel class of kivymd module
First Create a Python file (extension .py) then, create a kivy file (.kv extension) name of kivy file should be same as app name.
App name is the name of the class that consist of build function and created by inheriting the MDApp class
Following is the list of attributes used in this program :-
Attributes of MDScreen class
1. md_bg_color - To change the background color
2. radius - to change the corner radius of screen
Attributes of MDLabel class
1. text - to print the text on the screen
2. halign - To horizontally align the text on the screen (Values center,left,right)
3. theme_text_color : To change the color of the text (Values Primary, Secondary, Hint, Error and Custom)
Note : When the value of theme_text_color is Custom then we can use text_color attribute to change the color.
4. text_color - To change the color of text (Takes color values in rgb fromat)
5. font_size - To increase font size (takes numeric value)
6. bold - To make letters bold (takes True and False)
7. italic - To make letters italic (takes True and False)
Following is the code of this program :-
# Code of Python Program
from kivymd.app import MDApp
class Myapp(MDApp):
def build(self):
return
Myapp().run()
# save this by .py extension
Comments
Post a Comment