0

I want to make a script in python 3(preferably) in which I get an "input()" from the user, but the user may or may not give the input. So it should wait for some fixed time and if no input is given in that time follow default condition already set.

I have no idea, if there are any keywords I should search for.

Gaurav Kumar
  • 221
  • 3
  • 14
  • Search for "timeout decorator Python". – Paulo Scardine Feb 05 '18 at 18:37
  • 1
    @ChristianDean although it is a dupe the answers to that question are really old and most of the top answers are platform-specific. I would really like to see someone adding a Python 3.6 solution here. – Paulo Scardine Feb 05 '18 at 18:42
  • [Here](https://gist.github.com/PM2Ring/215147b4de22e158a7b1d78f40300031) is a simple example that works in a VT100-compatible terminal. Also see https://stackoverflow.com/q/45130837/4014959 – PM 2Ring Feb 05 '18 at 19:33

0 Answers0