import threading
def printit():
threading.Timer(5.0, printit).start()
print "Hello, World!"
printit()
# continue with the rest of your code
https://docs.python.org/3/library/threading.html#timer-objects
More Related Contents:
- How to run functions in parallel?
- threading.Timer – repeat function every ‘n’ seconds
- Freezing/Hanging tkinter GUI in waiting for the thread to complete
- Threading in a PyQt application: Use Qt threads or Python threads?
- Does Python support multithreading? Can it speed up execution time?
- What is the use of join() in Python threading?
- Is there any way to kill a Thread?
- How to start and stop a thread
- A very simple multithreading parallel URL fetching (without queue)
- background function in Python
- threading ignores KeyboardInterrupt exception
- Python: Something like `map` that works on threads [closed]
- Multi-threaded use of SQLAlchemy
- Python time.sleep() vs event.wait()
- How to exit the entire application from a Python thread?
- Overriding python threading.Thread.run()
- Python – appending to same file from multiple threads
- deciding among subprocess, multiprocessing, and thread in Python?
- How to get a faster speed when using multi-threading in python
- How to run multiple functions at the same time?
- What is the use of join() in threading?
- Python: How to NOT wait for a thread to finish to carry on? [duplicate]
- Threads vs. Async
- multiprocess or threading in python?
- subprocess.wait() not waiting for Popen process to finish (when using threads)?
- How to implement a Lock with a timeout in Python 2.7
- How do I send data to a running python thread?
- Multithreading with Python and C api
- How to use threading to get user input realtime while main still running in python
- Terminate a multi-thread python program