当前位置:网站首页>Kivy tutorial how to automatically load kV files
Kivy tutorial how to automatically load kV files
2022-07-03 13:21:00 【Knowledge fatness】
We can call this at will main.py file , but kv File is made up of Kivy self-loading , Therefore, it must be named after the application class . for example , If our application class is called , Should be named FooBarApp A corresponding file ( The class name is converted to lowercase , Without the suffix ). Strictly following this naming convention allows us to avoid manual loading Kivy Language file , This is undoubtedly a good thing —— Fewer lines of code lead to the same result
Combat code
Directory file
clock.kv main.py
File code
# File: main.py
from kivy.app import App
class ClockApp(App):
pass
if __name__ == '__main__':
ClockApp().run()
# File: clock.kv
BoxLayout:
orientation: 'vertical'
Label:
text: '00:00:00'
Run the project
Type... On the command line
ptyhon main.py
Running effect
边栏推荐
- Kotlin - improved decorator mode
- The shortage of graphics cards finally came to an end: 3070ti for more than 4000 yuan, 2000 yuan cheaper than the original price, and 3090ti
- Kivy教程之 如何通过字符串方式载入kv文件设计界面(教程含源码)
- SSH登录服务器发送提醒
- Annotation and reflection
- 2022-01-27 use liquibase to manage MySQL execution version
- 已解决(机器学习中查看数据信息报错)AttributeError: target_names
- 2022-01-27 redis cluster cluster proxy predixy analysis
- 双链笔记 RemNote 综合评测:快速输入、PDF 阅读、间隔重复/记忆
- Reptile
猜你喜欢
Comprehensive evaluation of double chain notes remnote: fast input, PDF reading, interval repetition / memory
(first) the most complete way to become God of Flink SQL in history (full text 180000 words, 138 cases, 42 pictures)
Flink SQL knows why (7): haven't you even seen the ETL and group AGG scenarios that are most suitable for Flink SQL?
MySQL
Solve system has not been booted with SYSTEMd as init system (PID 1) Can‘t operate.
人身变声器的原理
MySQL functions and related cases and exercises
This math book, which has been written by senior ml researchers for 7 years, is available in free electronic version
这本数学书AI圈都在转,资深ML研究员历时7年之作,免费电子版可看
Flink SQL knows why (16): dlink, a powerful tool for developing enterprises with Flink SQL
随机推荐
Task5: multi type emotion analysis
Introduction to the implementation principle of rxjs observable filter operator
The principle of human voice transformer
Kivy教程之 盒子布局 BoxLayout将子项排列在垂直或水平框中(教程含源码)
Sword finger offer 11 Rotate the minimum number of the array
Flink SQL knows why (7): haven't you even seen the ETL and group AGG scenarios that are most suitable for Flink SQL?
mysqlbetween实现选取介于两个值之间的数据范围
Kotlin - 改良装饰者模式
luoguP3694邦邦的大合唱站队
[Database Principle and Application Tutorial (4th Edition | wechat Edition) Chen Zhibo] [Chapter 7 exercises]
MySQL installation, uninstallation, initial password setting and general commands of Linux
2022-01-27 research on the minimum number of redis partitions
剑指 Offer 14- I. 剪绳子
Image component in ETS development mode of openharmony application development
Elk note 24 -- replace logstash consumption log with gohangout
The shortage of graphics cards finally came to an end: 3070ti for more than 4000 yuan, 2000 yuan cheaper than the original price, and 3090ti
sitesCMS v3.1.0发布,上线微信小程序
有限状态机FSM
Reptile
[Database Principle and Application Tutorial (4th Edition | wechat Edition) Chen Zhibo] [sqlserver2012 comprehensive exercise]