Relative Content

Tag Archive for multithreadinguser-interfacetkintermultiprocessingpython-asyncio

GUI unable to send messages through Manager().Queue() to the processes

Please guide me in the right direction if this is already answered. I have a GUI script that has several buttons and when I click the start button, it needs to send a message to a process which is using multiprocessing.Process(). This process is started in the main function. I am using a Queue object to send messages to this process. As an example, the process is an infinite while loop that terminates when it receives a ‘True’ value and ‘runs’ constantly for every ‘False’ value that it gets from the queue. There are two buttons, ‘start’ and ‘stop’. The ‘start’ button is what initiates this while loop that constantly sends ‘False’ to keep the process running. The ‘stop’ button sends a ‘True’ value that terminates the while loop, ending the process and eventually the program comes to an end. I read a few posts on something similar where people have recommended using asyncio to run the GUI and the process concurrently. The following is the class that creates the GUI: