title: Take a PDF file and take every word from it into a dictionary setting it equal to default 0
body: <p>Okay, so what I'm trying to do is take a URL for a PDF file of just simply open up the PDF file in the program and take out every word from it. Then put it inside a dictionary that set its default value to zero. My problem is that when I try to get the PDF from a URL it either just goes right to the PDF file on the internet or it just takes every line from it rather than every word. I've tried with .txt files and it just ends up doing every line as well instead of every word. </p>
  
  <p>Here is some code I've tried:</p>
  
  <pre><code>run = open('Harry.txt')
  
  def words(file):
  
      docline = {}
      docwords = {}
      for line in file:
          docline[line] = 0
      for word in docline:
          docwords[word] = 0
  
      return docwords
  
  print(dict(words(run)))   
  </code></pre>