title: Tkinter: Separating Processes
body: <p>I am trying to build a Tkinter program that supports multiprocessing. I need to read from multiple Modbus devices and display the output onto the GUI.</p>
  
  <p>I have successfully done this with a command line by using processes, but in Tkinter, my GUI freezes every time I attempt to read.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>import os
  from multiprocessing import Process
  import threading
  import queue
  import tkinter as tk
  from tkinter import *
  from tkinter import ttk
  import time
  import time as ttt
  import minimalmodbus
  import serial
  minimalmodbus.CLOSE_PORT_AFTER_EACH_CALL = True
  
  
  class Application(tk.Frame):
      def __init__(self, master=None):
          super().__init__(master)
          self.gas = minimalmodbus.Instrument('COM3', 1)
          self.gas.serial.baudrate = 9600
          self.gas.serial.parity = serial.PARITY_NONE
          self.gas.serial.bytesize = 8
          self.gas.serial.stopbits = 1
          self.gas.serial.timeout = 0.25
          self.gas.mode = minimalmodbus.MODE_RTU
  
          self.pack()
          self.create_widgets()
  
      def create_widgets(self):
          self.first_gas_labelframe = LabelFrame(self, text="Gas 1", width=100)
          self.first_gas_labelframe.pack()
  
          self.value_label = Label(self.first_gas_labelframe, text="Value")
          self.value_label.pack()
  
          self.unit_label = Label(self.first_gas_labelframe, text="Unit")
          self.unit_label.pack()
  
          self.temp_label = Label(self.first_gas_labelframe, text="Temp")
          self.temp_label.pack()
  
  
          self.timer_button = tk.Button(self, text='Start', command=self.process)
  
          self.quit = tk.Button(self, text="QUIT", fg="red", command=root.destroy)
          self.quit.pack()
  
          self.gas_list = [self.gas]
  
      def reader():
          self.read = gas_num.read_registers(0,42)
          self.value_label.config(text=self.read[0])
          self.unit_label.config(text=self.read[1])
          self.temp_label.config(text=self.read[2])
  
      def process(self):
          for sen in self.gas_list:
                  self.proc = Process(target=self.reader, args=(sen,))
                  self.proc.start()
                  self.proc.join()
  
  
  if __name__ == '__main__':
          root = tk.Tk()
          app = Application()
          app.mainloop()
  </code></pre>
  
  <p>When I press the start button the program will freeze until the process is done. How do I correctly set up a system to have the GUI operational while having processes run?</p>