Kivy is a platform-independent GUI tool in Python. It can run on Android, IOS, Linux and Windows, etc. This is the only GUI library from python which can independently run on the android device even we can use it on Raspberry pi also. It is an open-source Python library for the rapid development of multi-touch applications. Its graphic engine is built over OpenGL and it also supports a fast graphics pipeline.
This article focuses on creating a GUI window using kivy with a button and then add colors to it using hex color codes.
Approach
- Import kivy button
- Import kivy app
- Import kivy builder
- Create App class
- Create button
- Create mechanism to change color on click of the button
- Return builder string
- Run an instance of the class
Program:
Python3
from kivy.uix.button import Button
from kivy.app import App
from kivy.lang import Builder
class uiApp(App):
def build( self ):
return Builder.load_string(
)
uiApp().run()
|
Output:
Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape,
GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out -
check it out now!
Last Updated :
24 Feb, 2021
Like Article
Save Article