我正在开发一个使用 Python 下载和安装应用程序的项目。存储应用程序信息的存储库有一行json
表明用户是否通过验证,然后将其转换为True
或False
变量。下载用户信息后,它使用模块中的rich.print
功能在屏幕上打印信息rich
。我希望能够打印经过验证的符号,例如在 Twitter 上,我该怎么做?
manifest.json
{
"Name": "Test package",
"License": "Public Domain",
"Developer": "Hearth OS",
"DeveloperWWW": "https://hearth-os.github.io/",
"Description": "Hello World package.",
"Verified": "True",
"Version": "0.1",
"AppID": "com.hearth-os.test"
}
main.py (Lines 72-90)
# Write and open manifest.json
open("manifest.json", 'wb').write(r.content)
jsonFile = open("manifest.json", "r")
manifest = json.load(jsonFile)
# Read `manifest`
name = manifest['Name']
license = manifest['License']
developer = manifest['Developer']
www = manifest['DeveloperWWW']
description = manifest['Description']
verified = manifest['Verified']
version = manifest['Version']
id = manifest['AppID']
# Print `manifest`
rich.print('Package: ' + name)
rich.print('Developer: [link=' + www + ']' + developer + '[/link]')
rich.print('License: ' + license)