title: How to retrieve file name after choosing in dialog box using Python Tkinter
body: <p>Please advise on how to retrieve a file's full path into a variable after i pick one using tkinter</p>
  
  <p>The whole idea of my GUI is to:
  1. Have few buttions
  2. Have address bar with file's full address</p>
  
  <p>Once user clicks the button and picks the file >> file's path is displayed in the address bar as well as stored in a separate variable for future usage later in code</p>
  
  <p>I've done some testing, but when checking for retrieved value - I get None.</p>
  
  <pre><code>def file_picker():
      """Pick enova .xlsx file"""
      path = filedialog.askopenfilename(filetypes=(('Excel Documents', '*.xlsx'), ('All Files', '*.*')))
      return path
  
  file_button = tkinter.Button(root, text='Users File', width=20, height=3, 
  bg='white', command=custom_functions.file_picker).place(x=30, y=50)
  </code></pre>
  
  <p>Apart form that I found another code snippet, but this simply captures line onto the GUI interface, not saving file path in any variable though:</p>
  
  <pre><code>def browsefunc():
      filename = filedialog.askopenfilename()
      pathlabel.config(text=filename)
      print(pathlabel)
  
  
  browsebutton = tkinter.Button(root, text="Browse", command=browsefunc).pack()
  
  pathlabel = tkinter.Label(root).pack()
  </code></pre>
  
  <p>Expected result: <a href="https://imgur.com/a/NbiOPzG" rel="nofollow noreferrer">https://imgur.com/a/NbiOPzG</a> - unfortunatelly I cannot post images yet so uploaded one onto imgur</p>