sách gpt4 ăn đã đi

Python 命令行复选框

In lại 作者:太空狗 更新时间:2023-10-29 23:59:02 26 4
mua khóa gpt4 giày nike

我是 Python 2.7 的新手,但我想知道是否可以让用户通过命令行选择复选框。

我知道的唯一例子是 yeoman(见下文),但它可能不是用 Python 编写的。

nhập mô tả hình ảnh ở đây

Cảm ơn

câu trả lời hay nhất

hãy nhìn xem python-inquirer包。

要制作一个复选框列表,您可以这样做:

import inquirer

questions = [inquirer.Checkbox(
'interests',
message="What are you interested in?",
choices=['Computers', 'Books', 'Science', 'Nature', 'Fantasy', 'History'],
)]
answers = inquirer.prompt(questions) # returns a dict
print(answers['interests'])

关于Python 命令行复选框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23771768/

26 4 0
Chứng chỉ ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com
Xem sitemap của VNExpress