title: Does Python-import import lists?
body: <p>Hi i have 2 Python Files in the same directory:</p>
  <p><strong>paths.py:</strong></p>
  <pre><code>import os
  
  
  def Listfilesindirectory():
      
      os.chdir(input('Working Directory: '))
  
      pathlist = os.listdir()
  
      for i in range(len(pathlist)):
          print(pathlist[i] + '\n')
  </code></pre>
  <p><strong>main_hash.py:</strong></p>
  <pre><code>import defs
  import paths
  
  paths.Listfilesindirectory()
  
  
  
  hashlist = []
  
  for n in range(len(pathlist)):
      hashlist[n] = defs.hash_file(pathlist[n])
  
  print(hashlist)
  </code></pre>
  <p>First I import the paths.py file in main_hash.py; than in main.py I execute (is execute the right term??) the Listfilesindirectory that i defined in paths.py. No problem until here, it gets executed flawlessly. Than i want to use the list &quot;pathlist&quot; that i initiated in paths.py. But i get the following error code:</p>
  <pre><code>Traceback (most recent call last):
    File &quot;/Users/kyilmaz/Documents/Python/main_hash.py&quot;, line 10, in &lt;module&gt;
      for n in range(len(pathlist)):
  NameError: name 'pathlist' is not defined
  </code></pre>
  <p>Shouldn't &quot;pathlist&quot; be imported in main.py? I also tried: from paths import pathlist. Doesn't work.</p>