from __future__ import print_function

import time, os, hashlib, sys

start = time.clock()

m = hashlib.md5()
path = sys.argv[1]

print("Examining:", path)

for folder, subs, files in os.walk(path):
    for filename in files:
        filepath = os.path.join(folder, filename)
        with open(filepath, 'rb') as file:
            m.update(file.read())

checksum = m.hexdigest()
print("Checksum:", checksum)

end = time.clock()
print("Seconds:", end - start)
