如何在 Python 脚本中设置时间延迟?
最佳答案
这会延迟 2.5 秒:
import time
time.sleep(2.5)
这是另一个大约每分钟运行一次的示例:
import time
while True:
print("This prints once a minute.")
time.sleep(60) # Delay for 1 minute (60 seconds).
关于python - 我如何做一个时间延迟?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64468/