import time
time.sleep(5) # Delays for 5 seconds. You can also use a float value.
Here is another example where something is run approximately once a minute:
import time
while True:
print("This prints once a minute.")
time.sleep(60) # Delay for 1 minute (60 seconds).
More Related Contents:
- How do I make a time delay? [duplicate]
- How do I print a word on a line, and after every second it prints the word with one extra letter on the end of it every time
- asyncio.sleep() vs time.sleep() in Python
- Accepting only letters as input [closed]
- How to blit a random image from a list Pygame [duplicate]
- How can I represent an ‘Enum’ in Python?
- Concatenate strings from several rows using Pandas groupby
- Python : no module named selenium
- How to use pip with Python 3.x alongside Python 2.x
- Moving Average Pandas
- How can I periodically execute a function with asyncio?
- TypeError: worker() takes 0 positional arguments but 1 was given [duplicate]
- Python 3.7 – asyncio.sleep() and time.sleep()
- SyntaxError: Failed to execute ‘evaluate’ on ‘Document’: The string ‘//img[contains(‘1236548597′)]’ is not a valid XPath expression
- CSS not loading wrong MIME type Django [duplicate]
- What is “pkg-resources==0.0.0” in output of pip freeze command
- How to share numpy random state of a parent process with child processes?
- What is a “callable” in Python?
- How can I print multiple things (fixed text and/or variable values) on the same line, all at once?
- Why am I getting “invalid syntax” from an f-string? [duplicate]
- Check if rows in one dataframe exist in another dataframe
- How to change the voice in pyttsx3?
- How to reuse an expression in a comprehension expression?
- How to move the background image with keys in pygame?
- Building Python 3.7.1 – SSL module failed
- How to redirect from a view to another view In Django
- Python 3 chokes on CP-1252/ANSI reading
- What is the type hint for a (any) python module?
- Using Sympy Equations for Plotting
- How to convert only numbers in a mixed list into float