Skip to main content

Framework for generating formatted user input questions.

Project description

MultiChoice

MultiChoice is a framework for generating formatted user input queries on the terminal. Especially multiple choice questions.

Class: MultiChoice

MultiChoice(query, options, required=True, strict=True)

MultiChoice: Generates multiple choice questions.

__call__(self)

  • Return: String. Returns the user selection.

__init__(self, query, options, required=True, strict=True)

  • Param query: String. Question 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: Question

Question(query, required=True)

Question: Generates fill in the blank style questions.

__call__(self)

  • Return: String. Returns the user selection.

__init__(self, query, required=True)

  • Param query: String. Question for the user.
  • Param required: Bool. Default=True: True: Repeats question until answered. False: Accepts null input as an empty string.

Class: TrueFalse

TrueFalse(query, required=True, strict=True)

TrueFalse: Generates True or False style questions.

__call__(self)

  • Return: String. Returns the user selection.

__init__(self, query, required=True, strict=True)

  • Param query: String. Question 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.2.tar.gz (1.6 kB view details)

Uploaded Source

Built Distribution

MultiChoice-0.2-py3-none-any.whl (1.6 kB view details)

Uploaded Python 3

File details

Details for the file MultiChoice-0.2.tar.gz.

File metadata

  • Download URL: MultiChoice-0.2.tar.gz
  • Upload date:
  • Size: 1.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.4.2 requests/2.20.0 setuptools/41.4.0 requests-toolbelt/0.8.0 tqdm/4.27.0 CPython/3.7.4

File hashes

Hashes for MultiChoice-0.2.tar.gz
Algorithm Hash digest
SHA256 a316f00299e641db269a120097ca85b313d410840061efb0162df7e7c0f4b535
MD5 ebc94b83f4ba046e0cc4ced8b2645938
BLAKE2b-256 e082fd34bba145609dac6136abfed725dc99217d46307c1d7a028dc272a2e9f3

See more details on using hashes here.

File details

Details for the file MultiChoice-0.2-py3-none-any.whl.

File metadata

  • Download URL: MultiChoice-0.2-py3-none-any.whl
  • Upload date:
  • Size: 1.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.4.2 requests/2.20.0 setuptools/41.4.0 requests-toolbelt/0.8.0 tqdm/4.27.0 CPython/3.7.4

File hashes

Hashes for MultiChoice-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0d7b156dcc0d4801af7e29c0204ea7189abfbe9c90941cabc0f3b6a056264245
MD5 3226bad70f2d3e8d0ee95f18480205f7
BLAKE2b-256 b7d628a8881697b05f1842a13bd90799bc63adf4dde195ae20ed52b6279ad870

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page