title: How works after() and multiprocessing using tkinter
body: <p>I wondering how works <code>after()</code> and <code>multiprocessing</code> while using tkinter. Here is a pseudo example</p>
  <pre><code>import asyncio
  import tkinter as tk
  import multiprocessing as mp
  
  class pseudo_example():
  
  
      def app(self):
          self.root = tk.Tk()
          self.root.minsize(100,100)
  
          # multiprocessing
          start_button = tk.Button(self.root, text=&quot;start&quot;, command=lambda: mp.Process(target=self.create_await_fun).start())
          # regular call
          #start_button = tk.Button(self.root, text=&quot;start&quot;, command = self.create_await_fun())+
          start_button.pack()
  
          self.testfield = tk.Label(self.root, text=&quot;test&quot;)
          self.testfield.pack()
          self.root.mainloop()
  
      def create_await_fun(self):
          asyncio.run(self.await_fun())
  
      async def await_fun(self):
          # cross communication between two threads doesn't work jet
          #self.testfield[&quot;text&quot;] = &quot;start waiting&quot;
          #self.root.update_idletasks()
  
          print(&quot;start waiting&quot;)
          await asyncio.sleep(10)
          print(&quot;end waiting&quot;)
  
          #self.testfield[&quot;text&quot;] = &quot;end waiting&quot;
          #self.root.update_idletasks()
  
  
  if __name__ == '__main__':
      gui = pseudo_example()
      gui.app()
  </code></pre>
  <p>Now I have a few questions. When I run the program like this, the GUI does not freeze and I get my &quot;print&quot; output. Now I don't want to get a print output but I want to communicate with the GUI and update the label without the GUI freezing. Now I heard about the <code>after()</code> method, but I also read that this method doesn't call a new thread but delays the blocking of the GUI. If I have understood this correctly. Furthermore, I also read that tkinter is generally a single thread. Is there nevertheless a possibility to decouple the IO tasks from the GUI? For this, I would have to use the task outside of the mainloop()?</p>
  <p>in this entry <a href="https://stackoverflow.com/a/29158947/15959848">Tkinter understanding mainloop</a> there is an example of the <code> after()</code> method, but I could not derive an application for me. Here is another <a href="https://stackoverflow.com/a/459131/15959848">link</a> that deals with the topic but could not help me specifically.</p>