import threading import time def worker(): print("Worker thread starting...") time.sleep(1) print("Worker thread finishing.") thread = threading.Thread(target=worker) thread.start() thread.join() print("Main thread finishing.")