Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
可能重复: raw_input 和 timeout
raw_input()将等待用户输入。等待几秒钟后如何让它去?
raw_input()
一种可能的选择:
import select, sys r, w, x = select.select([sys.stdin], [], [], 3)
这将阻塞约 3 秒 - 任何存在的数据都将在r之后出现。
r