Python Newbie - AttributeError: 'module' object has no attribute 'a'
#!/usr/bin/python
I am trying to learn python and trying to write a simple script. There
seems to be a problem with using a raw_input created variable. I am sure
its simple, but I just don't have the background yet to figure this one
out. Here is what I've tried and what works:
import hashlib
v = raw_input("Enter your value: ")
print "Which hash algorithm do you want to use?"
# This fails
a = raw_input("md5, sha1, sha224, sha256, sha384, sha512: ")
h = hashlib.a(v)
h.hexdigest()
# This works
v = "password"
h = hashlib.md5(v)
h.hexdigest()
Thank You, Eric
No comments:
Post a Comment