From 30342b7bea827c515a1a32064e97a3dfb47b4c8f Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy Date: Sat, 2 Mar 2019 14:32:20 -0500 Subject: [PATCH] Compacted thread startup --- DemoPrograms/Demo_Multithreaded_Queued.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/DemoPrograms/Demo_Multithreaded_Queued.py b/DemoPrograms/Demo_Multithreaded_Queued.py index 09ebf8ac..735a8ae0 100644 --- a/DemoPrograms/Demo_Multithreaded_Queued.py +++ b/DemoPrograms/Demo_Multithreaded_Queued.py @@ -63,9 +63,7 @@ if __name__ == '__main__': #-- Create a Queue to communicate with GUI -- gui_queue = Queue() # queue used to communicate between the gui and the worker #-- Start worker threads, one runs twice as often as the other - thread = Thread(target=worker_thread, args=('Thread 1', 1000, gui_queue,), daemon=True) - thread.start() - thread = Thread(target=worker_thread, args=('Thread 2', 500, gui_queue,), daemon=True) - thread.start() + Thread(target=worker_thread, args=('Thread 1', 1000, gui_queue,), daemon=True).start() + Thread(target=worker_thread, args=('Thread 2', 500, gui_queue,), daemon=True).start() #-- Start the GUI passing in the Queue -- the_gui(gui_queue)