Kivy is a platform independent GUI tool in Python. As it can be run on Android, IOS, linux and Windows etc. It is basically used to develop the Android application, but it does not mean that it can not be used on Desktops applications.
In this we are going to see how can we create a stopwatch using label .
In the code i am creating just a counter using label in which when you set the time in seconds it will start decreasing like a countdown and in the second we will do the same by using clock object.
1) Kivy provides Clock objects.
2) Clock objects can be made to call a function when a specified time period has elapsed.
3) A clock object in Kivy can be configured to call a function upon every elapse of a time duration or only once.
It is good to use kivy inbuilt module while working with clock:
from kivy.clock import Clock
Basic Approach: 1) import kivy 2) import kivyApp 3) import label 4) import Animation 5) Import clock 6) import kivy properties(only needed one) 7) Set minimum version(optional) 8) Create Label class 9) Create App class 10) return Layout/widget/Class(according to requirement) 11) Run an instance of the class
# Simple Approach:
Note: Countdown start from 100 and ends on 0
# Now By using Clock Object:
Note: This starts from 0 and run until you cut the window
- Python | Create a stopwatch using clock object in kivy using .kv file
- Create a stopwatch using python
- Python | Create a digital clock using Tkinter
- How to create a list of object in Python class
- Python | Accordion in kivy
- GridLayouts in Kivy | Python
- Python | Animation in Kivy
- Python | Kivy .kv File
- Python| AnchorLayout in Kivy
- Python | StackLayout in Kivy
- Python | Bubble in kivy
- Python | Canvas in kivy
- Python | Scatter in kivy
- Python | PageLayout in Kivy
- Python | time.clock() method
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.