+ 1

Wait Function Python

Is there a wait funtion on python? Like wait 5 seconds until it prints something

5th Aug 2018, 3:06 PM
Kai
Kai - avatar
3 Respuestas
+ 2
As Qwertiony has hinted, it has a sleep method. import time time.sleep(5) #waits for 5 seconds
5th Aug 2018, 3:45 PM
Russ
Russ - avatar
+ 1
You can use the sleep() function in the time module. It will pause your Python program for the number of seconds we pass.  ex: import time # Wait for 5 seconds time.sleep(5) # Wait for 300 milliseconds # .3 can also be used time.sleep(.300)
5th Aug 2018, 6:43 PM
Nadun Kulatunge
Nadun Kulatunge - avatar
0
why wait when you can sleep?
5th Aug 2018, 3:40 PM
Qwertiony
Qwertiony - avatar