title: TKinter tkFileDialog.askopenfilename Always behind other windows
body: <p>I want to create a simple TKinter file selection dialog with a function that I will use from other scripts and not a wider GUI.</p>
  
  <p>My current code is:</p>
  
  <pre><code># Select a single file and return the full path as a string
  def select_file(data_dir):
  
      chdir(data_dir)
  
      root = Tkinter.Tk()
      root.withdraw()
  
      file_path = tkFileDialog.askopenfilename()
  
      return file_path
  </code></pre>
  
  <p>When I run this the file dialog is always behind other windows. If I have Spyder maximised, it opens behind it so I have to minimise.</p>
  
  <p>There are a few questions related to this, but I've been unable to get any of the suggested code to work, so apologies if this is viewed as a duplicate question.</p>
  
  <p>Ben</p>