outputhash = open('outputhashes.txt', 'w')
for line in inp:
    eachpwd = line.strip()
print(repr(line))
sha_1 = hashlib.sha1()
sha_1.update(eachpwd)
outputhash.write(sha_1.hexdigest())
outputhash.write('\n')
Compute SHA1 of Strings in python