Skip to main content

A Python module for selecting options in the Python interactive terminal.

Project description

INPUTSELECT

"inputselect" is a tool for selecting options on the Python command line. "inputselect" works by only presenting the user with the options that the developer wants them to pick, and forces them to choose before moving on. It eliminates the hassle of trying to get the user to choose only from a set of specific options, and fixes the trouble with typos and repeat loops.

API Reference

Allow the user to select options horizontally in the Python interactive terminal.

inputselect.List(message: str = "", choices=None, separator: str = " ", spin_speed: int = 0, colors=DEF_COLORS, underline=False):
Parameter Type Description
message string Not required. The message that the user sees before the options are presented to them.
choices list or tuple Required. The choices to be displayed on the terminal.
separator string Not required. The string that separates each option.
spin_speed integer Not required. The speed at which the choices spin (spins the display forwards if x>0, backwards if x<0, and lets the user choose if x=0)
colors list or tuple Not required. The respective colors of the text and bg of the option the user currently rests on (blue text and no bg by default)
underline boolean Not required. Whether or not to underline of the option the user currently rests on (False by default)

Allow the user to select options in a sort of vertical slider in the Python interactive terminal.

inputselect.Slider(message: str = "", choices=None, spin_speed: int = 0, colors=DEF_COLORS, wrap=True, underline=False):
Parameter Type Description
message string Not required. The message that the user sees before the options are presented to them.
choices list or tuple Required. The choices to be displayed on the terminal.
spin_speed integer Not required. The speed at which the choices spin (spins the display forwards if x>0, backwards if x<0, and lets the user choose if x=0)
colors list or tuple Not required. The respective colors of the text and bg of the option the user currently rests on (blue text and no bg by default)
wrap boolean Not required. Whether or not to give the slider a wrap-around feature
underline boolean Not required. Whether or not to underline of the option the user currently rests on (False by default)

Allow the user to check and uncheck options in the Python interactive terminal.

inputselect.Checkbox(message: str = "pick an animal: ", choices=None, separator: str = " ", min_choices=2, colors=DEF_COLORS, alt_colors=ALT_COLORS, underline=False):
Parameter Type Description
message string Not required. The message that the user sees before the options are presented to them.
choices list or tuple Required. The choices to be displayed on the terminal.
separator string Not required. The string that separates each option.
min_choices integer Not required. The minimum amount of choices for the user to pick before they can exit (by default it is set to 2)
max_choices integer Not required. The maximum amount of choices for the user to pick before they can exit (by default it is set to 2)
colors list or tuple Not required. The respective colors of the text and bg of the option the user currently rests on (blue text and no bg by default)
alt_colors list or tuple Not required. The respective colors of the text and bg of the option(s) the user has selected (yellow text and no bg by default)
underline boolean Not required. Whether or not to underline of the option the user currently rests on (False by default)

AUTHORS

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

inputselect-0.8.7.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

inputselect-0.8.7-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file inputselect-0.8.7.tar.gz.

File metadata

  • Download URL: inputselect-0.8.7.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.0

File hashes

Hashes for inputselect-0.8.7.tar.gz
Algorithm Hash digest
SHA256 dec0114ac59120d69ba84d83fc2856dc9c34181d40187fea1a545fceed1c5d61
MD5 9550144ca43492c299f307b67b756ba3
BLAKE2b-256 c9262db0216f20eabf8e659fdf43ff5f73a996990985c4f7ca7fc3dd1efcde14

See more details on using hashes here.

File details

Details for the file inputselect-0.8.7-py3-none-any.whl.

File metadata

  • Download URL: inputselect-0.8.7-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.0

File hashes

Hashes for inputselect-0.8.7-py3-none-any.whl
Algorithm Hash digest
SHA256 558b41d83c902680a7aa7351605886e200a63a2698e1d9850b6d5f757ed1c20a
MD5 3382e024ef461777bd880c95dca941ab
BLAKE2b-256 48feea3983ad60067e729e4583977a12fee4868909a7e95fe140d997252bfe09

See more details on using hashes here.

Supported by

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