Monday, July 10, 2017

May be you are wondering what Kivy is all about. Here is a simple example of kivy code that displays a button with text.

from kivy.app import App
from kivy.uix.button import Button
class MainApp(App):
    def build(self):
        return Button(text='Hello From Kivy')
if __name__=="__main__:
    MainApp().run()

The first thing you should never forget in a kivy app is importing the app class from the kivy.app module. The App has a build method in which you have to return your root widget, which in this case we used the Button widget from the kivy.uix module. Note that the heart of kivy is in the kivy.uix module which contains all necessary layouts and widgets to build your app.If ytou need to dirty your hands with more code, check the kivy website or you can send me a mail. Happy coding..

1 Comments:

At July 10, 2017 at 1:16 PM , Blogger Unknown said...

The legend of Kivy has just began. #GoodWork #KeepDoing

Inspired words by "Steve McConnell"
“ Good code is its own best documentation. As you're about to add a comment, ask yourself, "How can I improve the code so that this comment isn't needed?" Improve the code and then document it to make it even clearer. ”

 

Post a Comment

Subscribe to Post Comments [Atom]

<< Home