title: Printing file name and file path to a csv
body: <p>I am new to programming and am not sure of the best way to achieve my end goal.</p>
  
  <p>I would like to create a script that will walk through a directory tree with hundreds of systematically named image files and then print the file names and file paths to a csv. </p>
  
  <p>I understand how to use os.walk to list all images however I not sure how best to achieve my final output, e.g. should I create two lists (one with the file names and one with the file paths) or is there a better method for collecting my data for export to csv?</p>
  
  <pre><code>path = '/Users/User/Photos/'
  
  for root, dirs, files in os.walk(path):
      for x in files:
          file_path= os.path.join(root, x)
          print(file_path)
          file_name= os.path.basename(x)
          print(file_name)
  </code></pre>
  
  <p>Can somebody please point me towards the best method for printing the file_name and file_path pairs to a csv?</p>