title: Read all PDFs in a directory (image)
body: <p>I have attached an image to help show what I've done. I'm trying to write a program that will add a blank page to all PDFs in the directory that have an odd number of pages. However I can't seem to read all the PDFs in a directory. </p>
  
  <p>The script I have works on a single PDF, but I have 1000's of these to do. Why can't I read all the PDFs in the user_input directory?</p>
  
  <p><a href="https://i.stack.imgur.com/iekMy.png" rel="nofollow noreferrer">Screenshot of code and error here</a></p>
  
  <p>code is here</p>
  
  <pre><code>from PyPDF2 import PdfFileReader, PdfFileWriter, PdfFileMerger
  import os
  
  
  user_input = input("Enter the path of your file: ")
  files = os.listdir(user_input)
  
  for file in files:
      print(file)
      pdfReader = PdfFileReader(open(files, 'rb'))
  </code></pre>