当前位置:网站首页>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
边栏推荐
- Flink SQL knows why (19): the transformation between table and datastream (with source code)
- 2022-01-27 redis cluster brain crack problem analysis
- Kivy教程之 盒子布局 BoxLayout将子项排列在垂直或水平框中(教程含源码)
- STM32 and motor development (from MCU to architecture design)
- Task6: using transformer for emotion analysis
- Typeerror resolved: argument 'parser' has incorrect type (expected lxml.etree.\u baseparser, got type)
- Introduction to the implementation principle of rxjs observable filter operator
- Libuv库 - 设计概述(中文版)
- [Database Principle and Application Tutorial (4th Edition | wechat Edition) Chen Zhibo] [Chapter 6 exercises]
- Flink SQL knows why (17): Zeppelin, a sharp tool for developing Flink SQL
猜你喜欢
Flink SQL knows why (XV): changed the source code and realized a batch lookup join (with source code attached)
[Database Principle and Application Tutorial (4th Edition | wechat Edition) Chen Zhibo] [sqlserver2012 comprehensive exercise]
Today's sleep quality record 77 points
Elk note 24 -- replace logstash consumption log with gohangout
stm32和电机开发(从mcu到架构设计)
Sword finger offer 14- ii Cut rope II
Multi table query of MySQL - multi table relationship and related exercises
Flink SQL knows why (13): is it difficult to join streams? (next)
IDEA 全文搜索快捷键Ctr+Shift+F失效问题
The principle of human voice transformer
随机推荐
Flink SQL knows why (7): haven't you even seen the ETL and group AGG scenarios that are most suitable for Flink SQL?
2022-01-27 redis cluster technology research
已解决(机器学习中查看数据信息报错)AttributeError: target_names
双链笔记 RemNote 综合评测:快速输入、PDF 阅读、间隔重复/记忆
Sword finger offer 14- ii Cut rope II
Sitescms v3.0.2 release, upgrade jfinal and other dependencies
父亲和篮球
Sitescms v3.1.0 release, launch wechat applet
剑指 Offer 15. 二进制中1的个数
2022-01-27 redis cluster cluster proxy predixy analysis
106. How to improve the readability of SAP ui5 application routing URL
[Database Principle and Application Tutorial (4th Edition | wechat Edition) Chen Zhibo] [sqlserver2012 comprehensive exercise]
2022-02-11 heap sorting and recursion
Idea full text search shortcut ctr+shift+f failure problem
Image component in ETS development mode of openharmony application development
regular expression
MapReduce实现矩阵乘法–实现代码
2022-01-27 redis cluster brain crack problem analysis
2022-02-11 practice of using freetsdb to build an influxdb cluster
Annotation and reflection