Python command line flags

I am new to Python 2.7, but I was wondering if it is possible to have checkboxes that can be selected by the user through the command line.

The only example I know is yomen (below), but it probably isn't written in Python.

enter image description here

thank

+4
source share
2 answers

Check out the python-inquirer package.

To create a list of checkboxes, 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']) 
+3
source

, . gui easy gui, raw , ,

Want to do something? (Y/N)_ Y
0

Source: https://habr.com/ru/post/1541357/


All Articles