Skip to main content

Kivy Create First App

kivy is a open source python framework ,kivy run on Linux,Window,OS X, Android, iOS and Respberry Pi, You can run the same code on all supported platforms


Now create first app using kivy frame work

Step 1 : Install python on your operating system

Download or install python for this link https://www.python.org/downloads/

Step 2: Install Kivy Framework

Download or install kivy for this link https://kivy.org/doc/stable/gettingstarted/installation.html select the your operating system and install it


Step 3: Create first app code file main.py

from kivy.app import App

from kivy.uix.label import Label


class MainApp(App):

    def build(self):

        return Label(text="Hello this is first app")

if __name__ == "__main__":

    MainApp().run()



Step 4: Save the main.py file

Step 5: Open the terminal or cmd prompt  and set the main.py file path

Step 6: Enter the file name on terminal or cmd prompt python main.py  and hit enter your program  will run successfully

congratulation you can create first app successfully



thank you


Comments

Popular posts from this blog

Kivy App Run Method

 Create An App Now It is easy to create  simple kivy app  1.  Sub-Classing the App Class  2. Implemennting its build() function mathod so it returns a Widget instance the roon of app (the root of your app widget tree)  3. I nstantiating this class, and calling its  run()  method, run method is run the main app The sample of small app from kivy.app import App from kivy.uix.gridlayout import GridLayout from kivy.uix.label import Label from kivy.uix.textinput import TextInput class Loginscreen(GridLayout):     def __init__(self,**kwargs):          super(Loginscreen,self).__init__(**kwargs)          self.cols = 2          self.add_widget(Label(text="User Name"))          self.username = TextInput(multiline=False)          self.add_widget(self.username)          self.add_widget(Label(text="...