title: Tkinter: one or more mainloops?
body: <p>I have an already large <code>Tkinter</code> program, so that I have an <em>init</em> file, where the <code>root = Tk()</code> window is defined (containing basically a <code>Text</code> widget and a few other things), some more code, and last the call to <code>mainloop()</code> function.</p>
  
  <p>Everything works, until I needed to call a procedure <em>before</em> the <code>mainloop</code>, and I wanted to raise a <code>wait</code> window at the begin, to be destroyed at procedure's end.</p>
  
  <p>I wrote something like:</p>
  
  <pre><code>msg = Message(root, text='wait a few seconds...')
  msg.pack()
  </code></pre>
  
  <p>But it doesn't and cannot work, since <code>mainloop()</code> has not been called yet!</p>
  
  <p>If I instead do:</p>
  
  <pre><code>msg = Message(root, text='wait a few seconds...')
  msg.pack()
  mainloop()
  </code></pre>
  
  <p>The program stops at this first <code>mainloop</code>, doesn't finish the procedure call.</p>
  
  <p><code>mainloop()</code> should be used as your last program line, after which the Tkinter program works by a logic driven by user clicks and interactions, etc. </p>
  
  <p>Here, I need a sequence of <em>raise window > do stuff > destroy window > mainloop</em></p>