title: Python cant get full path name of file
body: <p>Trying to drill through a directory on my drive that has subfoldrs within it. When I find files that have the file extensions I'm looking for I want the full file path. Right now this is what I have:</p>
  
  <pre><code>import os
  import Tkinter
  import tkFileDialog
  from Tkinter import Tk
  from tkFileDialog import askopenfilename
  
  root = Tkinter.Tk().withdraw()
  dirname = tkFileDialog.askdirectory(initialdir='.')
  
  list = [] 
  
  
  for root, dirs, files in os.walk(dirname):
      for name in files:
          if name.find(".txt") != -1:
             name = str(name)
             name = os.path.realpath(name)
             list.append(name)
  
  print list
  </code></pre>
  
  <p>This is returned</p>
  
  <pre><code>c:\users\name\desktop\project\file.txt
  </code></pre>
  
  <p>however that file.txt is located in </p>
  
  <pre><code>c:\users\name\desktop\project\folder1\file.txt
  </code></pre>