title: Python function to choose a file in my PC
body: <p>I have a Python function that can search a folder in my PC, but I want to transform it in a function that can search for a file, specifically with the DOCX or PDF extensiom (i'll mange that later). This is what I have until now:</p>
  <pre><code>def choose_file(self):
  
      root = Tk()
      root.withdraw()
      path = askdirectory(title='Choose file')
      os.chdir(path)
  </code></pre>
  <p>That opens a Tkinter window that allows me to search for a folder. As I said before, I want to transform it into a tkinter window that searches a DOCX or PDF file, any solution?
  Thanks in advance!</p>