Python: Pause the program to run for n seconds

Hello, everyone, my name is wangzirui32, today we will learn how to suspend the program running for n seconds in Python.
It's very simple, just import the sleep function in the time module:

from time import sleep

print("程序开始运行")
sleep(5) # 这里我们暂停5秒
print("程序结束运行")

Today's course is here. Although it is very short, I hope you can learn the essence of it, bye!

Guess you like

Origin blog.csdn.net/wangzirui32/article/details/113880349