Skip to content

The same as standard python input() but with a timeout!

License

Notifications You must be signed in to change notification settings

OblivCode/input-with-timeout

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

input-with-timeout

The same as standard Python input() but with a timeout! Optimised (I think), written in pure Python though... The inaccuracy of time elapsed before timeout increases with the decrease in the polling rate, I might try to minimise this later.

Example:

from input_with_timeout import input_with_timeout

#4.2 seconds timeout
number = input_with_timeout(4.2, "Enter a number: ")

#None is returned if timeout
if number == None:
    print("You didn't enter a number in time!")
else:
    print("You entered: " + number) 

Installation

Install wheel file like a pypi package.

py -m pip install ./input_with_timeout-1-py3-none-any.whl

About

The same as standard python input() but with a timeout!

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages