[ACCEPTED]-Python Command Line Checkboxes-command-line-interface

Accepted answer
Score: 10

Have a look at the python-inquirer package.

To make a checkbox 1 list you can do something like this:

import inquirer

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

There is beaupy, which allows you to do something 2 like this:

from beaupy import select_multiple
pizza_toppings = select_mutliple(['pineapple', 'olives', 'anchovies', 'mozzarella', 'parma ham']

Note: I am a maintainer of beaupy and 1 this is nothing short of shameless self-promotion.

More Related questions