import time
      import threading
      
      new_thread = threading.Thread(target=target_function, args=(argument1,))
      new_thread.start()
      new_thread.join()
      Python language logo

      Create a thread

      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

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.