最佳答案
如何提示用户输入一些内容,但在 N 秒后超时?
谷歌指向 http://mail.python.org/pipermail/python-list/2006-January/533215.html上的一个邮件帖子,但它似乎不起作用。超时发生的语句,无论是 sys.input.readline
还是 timer.sleep()
,我总是得到:
<type 'exceptions.TypeError'>: [raw_]input expected at most 1 arguments, got 2
不知何故,除了没有捕捉到。