title: How to read all the files of a directory in python and save file data in a dictionary
body: <p>I have many documents in a folder. They in thousands in a .txt format. I want to read all of those documents and want to store documents content in a dictionary. The key of dictionary can be documents name and value should be content of that particular document. But right now I am only able to print all the names of my files but not able to make a dictionary where its content can be stored. I have written this code:</p>
  <pre><code>import os
  with os.scandir('docs/') as entries:
      for entry in entries:
          print(entry.name)
          with open('F:\folder\docs\'+entry.name) as f:
              contents = {'entry.name': f.read()}
  </code></pre>
  <p>Or if you can give me some new method to read content from all the files and then store it in a dictionary. Please help me in this regard. Thank you.</p>