Python suspends the program and waits for the next step to be executed

Pause for a fixed time: time.sleep() method

time.sleep(10), is to let the program pause for 10 seconds before continuing to execute, note that the unit is seconds.

import time
 #暂停10秒
time.sleep(10) 

Continue manually: os.system("pause")

When the program executes to this step, the program pauses and needs to press any key on the control end to continue.

import os
#控制端按下任意键继续
os.system("pause")

Guess you like

Origin blog.csdn.net/god_sword_/article/details/130817447
Recommended