我刚刚开始学习Python,我被代码困住了(下面)。我不知道是什么问题,但我不能选择药物和RDV不断显示两次。有什么帮助吗?
list = [inquirer.List(
"Medicine",
message="Choose from the given list",
choices=("RDV", "MOL", "TCZ", "DEX"),
),]
answer = inquirer.prompt(list)
print (answer["Medicine"])发布于 2022-08-29 18:55:36
我想这就是你想要的
#! /usr/bin/env python3
from PyInquirer import prompt
questions = [
{
'type': 'list',
'name': 'Medicine',
'message': 'Choose from the given list',
'choices': ["RDV", "MOL", "TCZ", "DEX"]
}
]
answers = prompt(questions)
print(answers)https://stackoverflow.com/questions/73533295
复制相似问题