title: Can I safely use a thread to call a script from a Tkinter application with subprocess.call?
body: <p>So I have a Tkinter application that I use at work.  I wrote another Tkinter application that I wanted to call from the main Tkinter application.  I know that Tkinter isn't 'thread safe', but I'm not 100% sure what that means.  Does it mean that it can 'work', but it isn't guaranteed to work as written?  Or should it just not work at all?  </p>
  
  <p>The reason I ask is because when I run the code below(self.thread_easy_imaging() is triggered by a filemenu option), it works just fine.  So far I haven't encountered any issues and both GUIs are operational so far as I can tell.  Is this because I'm using subprocess.call to call the script?  I'm having a hard time wrapping my head around this because I know you can't use thread in a Tkinter app to do something like run a function while still being able to use buttons in the GUI, but for some reason when I use a thread to call the script with subprocess.call it does it just fine.  When I wrote it, I assumed it wouldn't work, but for some odd reason it does.  Here is an example of the code I'm using:</p>
  
  <pre><code>def thread_easy_imaging(self): 
      thread.start_new_thread(self.start_easy_imaging, ('EASY-IMAGING-1', 0)) 
  def start_easy_imaging(self, thread_name, delay): 
      time.sleep(delay) #have to have args for some reason? I just did a delay of 0 seconds so I could use the tuple.
      subprocess.call(['c:/python27/python.exe', 'EasyImaging.py'])
  
  self.thread_easy_imaging()
  </code></pre>
  
  <p>I have only used this on a windows machine, but I'm guessing that it should work on any OS.</p>
  
  <p>Edit:  The scripts don't have to interact at all, I just want to add my other GUI application into the filemenu so I can call it as a separate application.  If needed, I'll just use a Toplevel widget to recreate the application I want to call because it won't muck up the main thread at all.</p>
  
  <p>Thanks in advance!</p>