title: Hash signatures for files
body: <p>I need to create a program that creates hash signatures for each file in my directory. I need the output to contain the filename and hash next to it.</p>
  
  <p>This is the code I have so far and all it is doing is giving me the hashes.</p>
  
  <pre><code>import os, hashlib
  
  path = "/home/ec2-user/environment"
  
  for filename in os.listdir(path):
      if not os.path.isdir(filename):
  
          hasher = hashlib.md5()
      with open('39802.jpeg', 'rb') as afile:
          buf = afile.read()
      hasher.update(buf)
      print(hasher.hexdigest())
  </code></pre>