Framework for generating formatted user input questions.
Project description
MultiChoice
MultiChoice is a framework for generating formatted user input questionnaires.
Class: MultiChoice
MultiChoice(prompt, options, required=True, strict=True)
Generates multiple choice questions.
__call__(self)
- Return: String. Returns the user selection.
__init__(self, prompt, options, required=True, strict=True)
- Param prompt: String. Question, query or prompt for the user.
- Param options: Tuple of Strings. Options presented to the user as a numbered sequence. The user may enter an answer as text or one of the numbers.
- Param required: Bool. Default=True: True: Repeats question until answered. False: Accepts null input as an empty string.
- Param strict: Bool. Default=True True: Answer must be in the options tuple. Not case-sensitive. False: Accepts any answer.
Class: FillBlank
FillBlank(prompt, required=True)
FillBlank: generates fill-in-the-blank questions.
__call__(self)
- Return: String. Returns the user selection.
__init__(self, prompt, required=True)
- Param prompt: String. Question, query or prompt for the user.
- Param required: Bool. Default=True: True: Repeats question until answered. False: Accepts null input as an empty string.
Class: TrueFalse
TrueFalse(prompt, required=True, strict=True)
TrueFalse generates True or False questions.
__call__(self)
- Return: String. Returns the user selection.
__init__(self, prompt, required=True, strict=True)
- Param prompt: String. Question, query or prompt for the user.
- Param required: Bool. Default=True: True: Repeats question until answered. False: Accepts null input as an empty string.
- Param strict: Bool. Default=True True: Answer must be in the options tuple. Not case-sensitive. False: Accepts any answer.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
MultiChoice-0.1.tar.gz
(1.6 kB
view hashes)
Built Distribution
Close
Hashes for MultiChoice-0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eac34f8e117b1cb0ad47c3f6f3ef45372b05e6467626c996d9ad55c819f53a38 |
|
MD5 | 81659a90b2d76f21974b4bdda83cde9b |
|
BLAKE2b-256 | 9c4d77d10e80e13acc5d248595c1709dd0625a5f0860f29573b636ccf4ebc1c2 |