PaddyKim
0
Q:

how to wait in python

import time
#Waits 1 second
time.sleep(1)
15
import time
def waitUntil(condition, output): #defines function
    wU = True
    while wU == True:
        if condition: #checks the condition
            output
            wU = False
        time.sleep(60) #waits 60s for preformance

waitUntil(Cookies >= 0, eatCookies()) #runs function (output MUST be another function)
2
# You need to import time first
import time
#now you have time you can make time wait/sleep
time.sleep(10)
#time will wait/sleep for 10 seconds
1
#Wait in python
#Module required - time
import time
#Wait in for the time you put
time.sleep(0.5)
print('Wait in python')
2
from time import sleep

>>> sleep(4)
0

New to Communities?

Join the community