【发布时间】:2015-04-10 00:36:56
【问题描述】:
我正在处理的程序需要暂停并询问用户输入,如果没有,请继续执行该程序。我认为它看起来像这样:
import time
...[code to run before break]...
if input in time.sleep(5):
[break out of normal code]
else:
[return to normal code]
[code to run after break]...
有什么想法吗?
编辑:当我询问时没有考虑这一点,但我正在运行 Windows (8.1)。
【问题讨论】:
-
Google 是您的编码朋友...stackoverflow.com/questions/1335507/… [1]: stackoverflow.com/questions/1335507/…
-
没有想到使用“超时”这个词。这就解释了为什么我无法在 google 上获得结果。