在python中,当脚本像time.sleep()
一样休眠时,是否可以运行代码或执行操作?我要做的是打印一条消息并收集用户的输入,直到消息打印后10秒。我一开始以为我能做到
print "You have ten seconds to answer the question."
print "The question"
time.sleep(10) and input() simultaneously
print "You are out of time"
这可能吗?如果没有,有没有办法完成同样的事情?你知道吗
Tags:
睡觉的时候你什么也做不了。在Unix/Linux上查找报警(2)系统调用是否在一段时间后中断。你知道吗
相关问题 更多 >
编程相关推荐