Skip to main content

The 'input-with-timeout' module provides a cross-platform method to capture user input with a timeout feature.

Project description

Input with Timeout

This Python project provides a function input_with_timeout which allows capturing user input with a specified timeout. If the user does not provide input within the timeout period, a TimeoutError is raised.

Installation

You can install this packag using the following commands:

pip install input-with-timeout

or

pip install git+https://github.com/mamahoos/python-input-with-timeout

Features

  • Customizable timeout for user input.
  • Cross-platform support.
  • Easy integration with existing Python projects.

Usage

To use the input_with_timeout function, simply import it from the module and call it with the desired prompt and timeout values.

from input_with_timeout import input_with_timeout

try:
    user_input = input_with_timeout("Enter your input: ", timeout=10)
    print(f"Input received: '{user_input}'.")
except TimeoutError:
    print("No input received within the timeout period.")

Contact

If you want to contact me you can reach me at https://t.me/mamahoos .

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

input-with-timeout-2.1.tar.gz (4.9 kB view details)

Uploaded Source

File details

Details for the file input-with-timeout-2.1.tar.gz.

File metadata

  • Download URL: input-with-timeout-2.1.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.8

File hashes

Hashes for input-with-timeout-2.1.tar.gz
Algorithm Hash digest
SHA256 ff494f491631158ac5f7699ede4df968e34a15feff66af633051a4ead7689787
MD5 7039e7b85eed19d3fb7197f2e4b2d483
BLAKE2b-256 0277b2340b1c76ddfa1890d4783ead0af2ae87b76b8336d3943f4772fe09b7b5

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