I\'ve been trying to find a good limited-input-time code for python scripts and I finally got a code to work:
from threading import Timer timeout = 5 t = T