簡體   English   中英

Python 的初學者 - 詢問者的問題

[英]Beginner at Python - problem with inquirer

我剛剛開始學習 Python 並且我堅持使用代碼(如下)。 我不知道出了什么問題,但我無法選擇葯物,RDV 不斷出現兩次。 有什么幫助嗎?

list = [inquirer.List(
  "Medicine",
  message="Choose from the given list",
  choices=("RDV", "MOL", "TCZ", "DEX"),
),]

answer = inquirer.prompt(list)

print (answer["Medicine"])

我想這就是你想要的

#! /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)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM