'I have an issue with coding this section of my project
i am trying to implement a piece of code that waits for a certain time before allowing a user to do something
i've been using help from the Internet and a coding book that i have
start=time.strftime("%H:%M")
if time.strftime("%H:%M")==("start"+"1%M"):
print("done")
i would like the output to force a player to wait for some time then be able to carry on
Solution 1:[1]
Use the time.sleep(num_seconds)
command:
import time
...
# do some things
time.sleep(5) # wait for 5 seconds doing nothing
# continue doing other things
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Green Cloak Guy |