Skip to main content

functions for reading command-line input with type checking and optional value checking

Project description

This module defines several general-purpose functions:

- The functions `get_bool`, `get_int`, `get_float`, and `get_str` facilitate the
reading interactive input from the command line, with type checks and optional
value checks on the user input. (The Python Standard Library provides a rather
minimal capability for reading command-line input).

- The function `make_check` generates a function as its output; the generated
function tests a value against an arbitrary condition, and can be passed to any
of the above command-line input functions.

- The function `str2int` converts a string to an integer, with somewhat more
flexible rules for input formatting than those imposed by Python's `int`

Project details

Release history Release notifications | RSS feed

This version


Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page