- Kivy Blueprints
- Mark Vasilkov
- 276字
- 2021-08-06 19:18:46
Chapter 1. Building a Clock App
This book will walk you through the creation of nine little Kivy programs, each resembling a real-world use case for the Kivy framework. On many occasions, the framework will be utilized together with other Python modules fitting for the task at hand. We will see that Kivy provides a great deal of flexibility, allowing us to solve vastly different problems in a clean, concise manner.
Let's start small. In this chapter, we will build a simple Clock app, similar in concept to the built-in application found in both iOS and Android. In the first part of the chapter, we will create a non-interactive digital clock display and style it, giving our program an Android-ish flat look. We will also briefly discuss the event-driven program flow and a Kivy main loop, introducing timers used to perform recurring tasks, such as updating the screen every frame.
In the second part of this chapter, we will add a stopwatch display and controls, creating a fluid layout suitable for any screen size and orientation. A stopwatch, naturally, needs user interaction, which we are going to implement last.
The important topics introduced in this chapter are as follows:
Our finished program, depicted in the following screenshot, will only be about 60 lines long, split equally between a Python source code and a Kivy language (.kv
) interface definition file.

The final look of the Clock app we're going to build.
- C#程序設(shè)計(jì)實(shí)訓(xùn)指導(dǎo)書(shū)
- Python數(shù)據(jù)分析入門(mén)與實(shí)戰(zhàn)
- Java高并發(fā)核心編程(卷2):多線程、鎖、JMM、JUC、高并發(fā)設(shè)計(jì)模式
- 深入理解Django:框架內(nèi)幕與實(shí)現(xiàn)原理
- 算法基礎(chǔ):打開(kāi)程序設(shè)計(jì)之門(mén)
- Mastering C# Concurrency
- Java Web應(yīng)用開(kāi)發(fā)技術(shù)與案例教程(第2版)
- C語(yǔ)言程序設(shè)計(jì)案例式教程
- Python機(jī)器學(xué)習(xí):預(yù)測(cè)分析核心算法
- Python Interviews
- FFmpeg開(kāi)發(fā)實(shí)戰(zhàn):從零基礎(chǔ)到短視頻上線
- 3D Printing Designs:The Sun Puzzle
- Java面向?qū)ο蟪绦蛟O(shè)計(jì)教程
- Learning NHibernate 4
- Puppet Essentials