Python public recipes
This code creates a new thread that calls the target_function with the arg1 argument. The new_thread.join() method causes the new thread to end and return to the main thread.
Shortcut: threading.create
import time
import threading
new_thread = threading.Thread(target=target_function, args=(argument1,))
new_thread.start()
new_thread.join()