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
timeoutfor 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file input_with_timeout-2.2.tar.gz.
File metadata
- Download URL: input_with_timeout-2.2.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
852a369b2d65281577773cade69ca82b38379a667f81eb4ecef3ac0cd57407d5
|
|
| MD5 |
ab7257285366db91c6cf97a5de114bf0
|
|
| BLAKE2b-256 |
69ce6f561ffdedfd05634b2eeea0d7e189c88b61ddb2ef424e2474a7de9e58fb
|
File details
Details for the file input_with_timeout-2.2-py3-none-any.whl.
File metadata
- Download URL: input_with_timeout-2.2-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2de8783ea9ccc2a0bed865f705feb3b81914325016ebfa2d6181e0c5849d83be
|
|
| MD5 |
418d9f11b004856d7b128692e8cd5d6c
|
|
| BLAKE2b-256 |
ccf2cdb8b913f37bdcd3d5844c28492b49b5243536500170b71a7ca655892e14
|