是否这可能在Python?我用Python编写了一个很棒的循环/脚本,如果可能的话,我想把这个延迟添加到它.
map(firefox.open, ['http://www.bing.com/search?q=' + str(i) for i in range(x))], [2] * x)
Run Code Online (Sandbox Code Playgroud)
我应该把它放在哪里sleep(6)?
你可以使用time.sleep(some_seconds).
from time import sleep
for i in range(10):
print i
sleep(0.5) #in seconds
Run Code Online (Sandbox Code Playgroud)
这是一个很酷的小实现:(将其粘贴到.py文件中并运行它)
from time import sleep
for i in range(101):
print '\r'+str(i)+'% completed',
time.sleep(0.1)
Run Code Online (Sandbox Code Playgroud)
map(firefox.open,[' http://www.bing.com/search?q='+ str(i)for i in range(x))],[2]*x)