threading.Thread() vs thread.Thread.start()
threading.Thread() and thread.Thread.start() are both Python Threading Module APIs, and choosing between them is a common point of confusion. This page compares their syntax, parameters, return values, and typical use cases so you can pick the right one. threading.Thread(): Creates a new thread object that runs the target function with args. Its syntax is threading.Thread(group=None, target=None, name=None, args=(), kwargs={}, *, daemon=None), and it returns thread object thread.Thread.start(): Starts the thread activity. Must be called at most once per thread. Its syntax is thread.Thread.start(), and it returns none Example of threading.Thread(): import threading
def work():
print("Thread running")
t = threading.Thread(target=work)
t.start()
t.join(). Example of thread.Thread.start(): t.start() # Begins execution in a new thread. Read the full references for threading.Thread() and thread.Thread.start() to see parameters, edge cases, and example code side by side. Other Threading Module APIs worth comparing: thread.Thread.join(), threading.Lock(), threading.RLock(), threading.Semaphore(), threading.Event(), threading.local().