Skip to main content

Module prompt

Module prompt 

Source
Expand description

Interactive terminal prompts.

Reads from the terminal directly (/dev/tty on Unix, CONIN$ on Windows) so prompts work even when stdin is piped.

Functionsยง

ask_choice
Present a numbered menu and return the selected index (1-based).
ask_text
Ask for free-text input with a default value.
ask_yn
Ask a yes/no question. Returns default on empty input.