hydrac.util.query

Utilities to query (hydrac.util.query)

hydrac.util.query.query_yes_no(question, default='yes')[source]

Ask a yes/no question and return the answer.

This method originates from fluiddyn (https://fluiddyn.readthedocs.io/en/latest/index.html)

Parameters:
question : string

String that is presented to the user.

default : bool

The default answer if the user just hits <Enter>. It must be “yes” (the default), “no” or None (meaning an answer is required of the user).

Returns:
answer : bool

The returned answer.

Functions

call_bash(commands)
num_from_str(s) Return a num computed from a string.
query(question[, default]) Query an anwer to a general question.
query_number(question) Query a number.
query_yes_no(question[, default]) Ask a yes/no question and return the answer.
run_asking_agreement(command) Use query_yes_no to ask if a command should be run.