bundles / IPython 9.5.0 / IPython / utils / io / ask_yes_no
function
IPython.utils.io:ask_yes_no
source: /IPython/utils/io.py :82
Signature
def ask_yes_no ( prompt , default = None , interrupt = None ) Summary
Asks a question and returns a boolean (y/n) answer.
Extended Summary
If default is given (one of 'y','n'), it is used if the user input is empty. If interrupt is given (one of 'y','n'), it is used if the user presses Ctrl-C. Otherwise the question is repeated until an answer is given.
An EOF is treated as the default answer. If there is no default, an exception is raised to prevent infinite loops.
Valid answers are: y/yes/n/no (match is not case sensitive).
Aliases
-
IPython.core.interactiveshell.ask_yes_no