title: printing the return of a function. UnboundLocalError: local variable 'file' referenced before assignment
body: <p>Have trouble with this small bit of code. Getting the error in the title. Can someone possible fix it for me or tell me where I am going wrong. Thanks </p>
  
  <pre><code>import tkinter as Tk
  
  from tkinter import filedialog 
  
  def chooseDcmFile():
  
    root.filename = filedialog.askopenfilename(initialdir="/", title="Select dcm File", filetypes=("dcm files", "*.dcm"))
  
    file = root.filename
  
    return(file)
  
  
  from pydicom import dcmread
  
  def dcmread():
  
     if file == none:
  
      file = chooseDcmFile()
  
     dcmFullData=dcmread(file)
  
     return (dcmFullData)   
  
  print dcmread() 
  </code></pre>