当前位置:网站首页>Kivy教程之 格式化文本 (教程含源码)
Kivy教程之 格式化文本 (教程含源码)
2022-07-04 03:53:00 【知识大胖】
格式化文本
最多流行和普遍使用的标记语言毫无疑问是HTML。另一方面,Kivy 实现了 BBCode 的变体,这是一种曾经用于格式化许多留言板上的帖子的标记语言。与 HTML 的明显区别在于 BBCode 使用方括号作为标签分隔符。
这Kivy 中提供了以下标签:
为了实现所需的格式(小时为粗体,其余文本为fn_regular细字体),我们可以使用以下代码:
Label:
text: '[b]00[/b]:00:00'
markup: True
实战代码
from kivy.app import App
from kivy.lang import Builder
# File: clock.kv
KV = '''
BoxLayout:
orientation: 'vertical'
Label:
text: 'normal:11:00:00'
Label:
text: 'format:[b]00[/b]:00:00'
markup: True
'''
class ClockApp(App):
def build(self):
return Builder.load_string(KV)
if __name__
边栏推荐
- Emlog user registration plug-in is worth 80 yuan
- Why use node
- Redis: operation command for collecting set type data
- leetcode刷题:二叉树06(对称二叉树)
- 西部数据绿盘、蓝盘、黑盘、红盘和紫盘有什么区别
- Detailed explanation of event cycle
- 架构实战营 - 第 6 期 模块九之毕业设计
- UnicodeDecodeError: ‘gbk‘ codec can‘t decode byte 0x98 in position 1093: illegal multibyte sequence
- 架构训练毕业设计+总结
- RHCSA 04 - 进程管理
猜你喜欢
PPt 教程,如何在 PowerPoint 中将演示文稿另存为 PDF 文件?
什么是上下文?
leetcode刷题:二叉树09(二叉树的最小深度)
Redis: order collection Zset type data operation command
Leetcode skimming: binary tree 08 (maximum depth of n-ary tree)
Flink learning 7: application structure
最长递增子序列问题(你真的会了吗)
96% of the collected traffic is prevented by bubble mart of cloud hosting
FT2000+下LPC中断绑核使用说明
浅谈JVM的那些事
随机推荐
深入解析结构化异常处理(SEH) - by Matt Pietrek
leetcode:1314. Matrix area and [2D prefix and template]
【微服务|openfeign】@FeignClient详解
dried food! Generation of rare samples based on GaN
Flink learning 6: programming model
Application scheme of Puyuan ds1000z series digital oscilloscope in communication principle experiment
资深开发人员告诉你,怎样编写出优秀的代码?
Rhcsa 03 - Basic permissions for documents
Pytest basic self-study series (I)
B. All Distinct
Leetcode skimming: binary tree 09 (minimum depth of binary tree)
Touch and take you to implement an EventEmitter
微信公众号无限回调授权系统源码
Dry goods | detailed explanation of webshell Foundation
软件测试是干什么的 发现缺陷错误,提高软件的质量
How to add custom API objects in kubernetes (1)
Redis:有序集合zset类型数据操作命令
微信脑力比拼答题小程序_支持流量主带最新题库文件
Understand the principle of bytecode enhancement technology through the jvm-sandbox source code
Longest increasing subsequence problem (do you really know it)