python - Python 中的 {!text!} 是什么?

标签 python

{!info!} 和 {!input!} 在此 python 代码中做了什么?

s += " {!info!}Down Speed: {!input!}%s" % common.fspeed(status["download_payload_rate"])

取自:http://git.deluge-torrent.org/deluge/tree/deluge/ui/console/commands/info.py?h=1.3-stable

谢谢。

最佳答案

它们对 Python 没有任何意义。字符串 s 将逐字包含 {!info!}{!input!}。但是,该字符串后来由 Deluge 本身解释以进行颜色格式化 — 参见 ui/console/colors.py ,特别是 parse_color_string

关于python - Python 中的 {!text!} 是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17204864/

相关文章:

python - 使用python从csv文件中提取部分数据

python - 如何避免此 "' 元组'对象没有属性 'photo'“我的自定义用户模块中的错误?

python - 如何计算Python中包含特定项目的列表的项目总数

python - 让 cv2.imread 从文件对象或类似内存流的数据中读取图像(这里是非提取的 tar)

python - Linux shell : Base64 Decode with removing line breaks

python - 为什么这个 TensorFlow 示例在激活函数之前没有求和?

python - 优雅地处理可变数量的输入和输出文件

python - 在同一个循环中迭代两个列表

python - 在排序的、固定大小的列表/python 中运行前 k 个元素

java - 在多个输入文件上运行终端程序