我正在使用模块inquirer编写一些python,它将结果作为python字典返回,如下所示:
{'Apps': ['Notes']}
我想知道是否有可能得到'Notes'
位?选择的代码在下面,但我不认为它是相关的。你知道吗
import os
import inquirer
def app_menu():
selections = [inquirer.Checkbox('Apps',
message='Please select you app',
choices=['Weather', 'Notes', 'Calculator', 'Exit'])]
app_sel = inquirer.prompt(selections)
print(app_sel.values())
假设您在dict中有一个名为“result”的result,如下所示
你可以直接得到它作为
试试这个:
或者,如果您确定列表中只有一个元素:
相关问题 更多 >
编程相关推荐