# 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:
```bash
pip install input-with-timeout
```
or
```bash
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.
```python
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 .
Raw data
{
"_id": null,
"home_page": "http://github.com/mamahoos/input_with_timeout",
"name": "input-with-timeout",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "python, cross-platform, stdout, stin, console",
"author": "mamahoos",
"author_email": "m4m4hoos@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/69/ce/6f561ffdedfd05634b2eeea0d7e189c88b61ddb2ef424e2474a7de9e58fb/input_with_timeout-2.2.tar.gz",
"platform": null,
"description": "# Input with Timeout\r\n\r\nThis 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.\r\n\r\n## Installation\r\nYou can install this packag using the following commands:\r\n```bash\r\npip install input-with-timeout\r\n```\r\n or\r\n```bash\r\npip install git+https://github.com/mamahoos/python-input-with-timeout\r\n```\r\n\r\n## Features\r\n\r\n- Customizable `timeout` for user input.\r\n- Cross-platform support.\r\n- Easy integration with existing Python projects.\r\n\r\n## Usage\r\n\r\nTo use the `input_with_timeout` function, simply import it from the module and call it with the desired prompt and `timeout` values.\r\n\r\n\r\n```python\r\nfrom input_with_timeout import input_with_timeout\r\n\r\ntry:\r\n user_input = input_with_timeout(\"Enter your input: \", timeout=10)\r\n print(f\"Input received: '{user_input}'.\")\r\nexcept TimeoutError:\r\n print(\"No input received within the timeout period.\")\r\n```\r\n## Contact\r\nIf you want to contact me you can reach me at https://t.me/mamahoos .\r\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "The 'input-with-timeout' module provides a cross-platform method to capture user input with a timeout feature.",
"version": "2.2",
"project_urls": {
"Homepage": "http://github.com/mamahoos/input_with_timeout"
},
"split_keywords": [
"python",
" cross-platform",
" stdout",
" stin",
" console"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ccf2cdb8b913f37bdcd3d5844c28492b49b5243536500170b71a7ca655892e14",
"md5": "418d9f11b004856d7b128692e8cd5d6c",
"sha256": "2de8783ea9ccc2a0bed865f705feb3b81914325016ebfa2d6181e0c5849d83be"
},
"downloads": -1,
"filename": "input_with_timeout-2.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "418d9f11b004856d7b128692e8cd5d6c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 6146,
"upload_time": "2024-04-15T07:05:40",
"upload_time_iso_8601": "2024-04-15T07:05:40.204282Z",
"url": "https://files.pythonhosted.org/packages/cc/f2/cdb8b913f37bdcd3d5844c28492b49b5243536500170b71a7ca655892e14/input_with_timeout-2.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "69ce6f561ffdedfd05634b2eeea0d7e189c88b61ddb2ef424e2474a7de9e58fb",
"md5": "ab7257285366db91c6cf97a5de114bf0",
"sha256": "852a369b2d65281577773cade69ca82b38379a667f81eb4ecef3ac0cd57407d5"
},
"downloads": -1,
"filename": "input_with_timeout-2.2.tar.gz",
"has_sig": false,
"md5_digest": "ab7257285366db91c6cf97a5de114bf0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 4856,
"upload_time": "2024-04-15T07:05:42",
"upload_time_iso_8601": "2024-04-15T07:05:42.734742Z",
"url": "https://files.pythonhosted.org/packages/69/ce/6f561ffdedfd05634b2eeea0d7e189c88b61ddb2ef424e2474a7de9e58fb/input_with_timeout-2.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-15 07:05:42",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "mamahoos",
"github_project": "input_with_timeout",
"github_not_found": true,
"lcname": "input-with-timeout"
}