I am new to Python 2.7 but I was wondering if it is possible to have checkboxes that are selectable by a user via the command line.
The only example I know of is yeoman (below) but its probably not written in Python.
Thank You
Have a look at the python-inquirer package.
To make a checkbox list you can do something like this:
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'])
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With