Skip to content

rs_rich.prompt

Generated from the type stubs by scripts/gen_python_api.py; do not edit.

rich.prompt: Prompt, Confirm, IntPrompt and FloatPrompt.

Confirm

Bases: PromptBase

process_response

process_response(value: str) -> bool

FloatPrompt

Bases: PromptBase

IntPrompt

Bases: PromptBase

InvalidResponse

Bases: PromptError

message instance-attribute

message: Any

Prompt

Bases: PromptBase

PromptBase

response_type instance-attribute

response_type: type

validate_error_message instance-attribute

validate_error_message: str

illegal_choice_message instance-attribute

illegal_choice_message: str

prompt_suffix instance-attribute

prompt_suffix: str

choices instance-attribute

choices: Optional[List[str]]

console instance-attribute

console: Console

prompt instance-attribute

prompt: Text

password instance-attribute

password: bool

case_sensitive instance-attribute

case_sensitive: bool

show_default instance-attribute

show_default: bool

show_choices instance-attribute

show_choices: bool

ask classmethod

ask(prompt: Union[str, Text] = '', *, console: Optional[Console] = None, password: bool = False, choices: Optional[List[str]] = None, case_sensitive: bool = True, show_default: bool = True, show_choices: bool = True, default: Any = ..., stream: Optional[IO[str]] = None) -> Any

render_default

render_default(default: Any) -> Text

make_prompt

make_prompt(default: Any) -> Text

get_input classmethod

get_input(console: Console, prompt: Union[str, Text], password: bool, stream: Optional[IO[str]] = None) -> str

check_choice

check_choice(value: str) -> bool

process_response

process_response(value: str) -> Any

on_validate_error

on_validate_error(value: str, error: InvalidResponse) -> None

pre_prompt

pre_prompt() -> None

PromptError

Bases: Exception