Skip to content

This project includes a function in the python programming language that receives user input with a timeout.

License

Notifications You must be signed in to change notification settings

mamahoos/python-input-with-timeout

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 .

About

This project includes a function in the python programming language that receives user input with a timeout.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages