title: How to print name of each file , and content in directory?
body: <p>I have many text files in a directory and I want to print each file name and its content. The problem is the content is duplicated from the previous file to the next file. Here is my code:</p>
  
  <pre><code>import os
  directory = os.listdir('/Users/user/My Documents/test/')
  os.chdir('/Users/user/My Documents/test/')
  for file in directory:
      open_file = open(file,'r')
      read_file = open_file.read()
      print(open_file.name)
      print("***************")
      print(read_file)
  </code></pre>
  
  <p>it's print out as an example:</p>
  
  <pre><code>a.txt
   This is file1.
   ***********
  b.txt
  This is file1. This file 2
  </code></pre>
  
  <p>..
  any suggestion?..Thanks in advance</p>