May 2017
Beginner to intermediate
444 pages
11h 31m
English
In order to create queues in Python, we have to import the Queue class from the queue module. Add the following statement towards the top of our GUI module:
from threading import Thread from queue import Queue
That gets us started.
Next, we create a queue instance:
def use_queues(self): gui_queue = Queue() # create queue instance print(gui_queue) # print instance
We call the method within our button click event:
# Button callback def click_me(self): self.action.configure(text='Hello ' + self.name.get()) self.create_thread() self.use_queues()
Read now
Unlock full access