title: "AttributeError: 'NoneType' object has no attribute 'listdir'"
body: <pre><code>def getfilename():
      prefixed = [filename for filename in os.listdir(filelocation) if filename.startswith("V")] 
      print prefixed
      return prefixed
  </code></pre>
  
  <p>Above function gives me an error "AttributeError: 'NoneType' object has no attribute 'listdir'</p>
  
  <p>Please help me resolve it</p>