python中的时间延迟

Time delay in python

本问题已经有最佳答案,请猛点这里访问。

我如何使一些东西在python中有一个小的延迟?

我想在3秒钟后显示一些内容,然后让用户输入一些内容。

这是我的东西

1
2
print"Think of a number between 1 and 100"
print"Then I shall guess the number"

我想在这里耽搁一下

1
2
print"I guess", computerguess
raw_input ("Is it lower or higher?")


this should work。P></

1
2
3
4
5
6
7
8
import time
print"Think of a number between 1 and 100"
print"Then I shall guess the number"

time.sleep(3)

print"I guess", computerguess
raw_input ("Is it lower or higher?")


1
2
3
4
5
6
7
8
9
    import time

    print"Think of a number between 1 and 100"
    print"Then I shall guess the number"

    time.sleep(3)

    print"I guess", computerguess
    raw_input ("Is it lower or higher?")


试试这个:P></

1
2
3
4
5
6
7
8
9
import time

print"Think of a number between 1 and 100"
print"Then I shall guess the number"

time.sleep(3)

print"I guess", computerguess
raw_input ("Is it lower or higher?")

the number of seconds to the number 3indicates休息。读这里。P></