Problem with sha.new
Dan Sommers
me at privacy.net
Sat Jul 9 08:16:57 EDT 2005
On Sat, 09 Jul 2005 13:49:12 +0200,
Florian Lindner <Florian.Lindner at xgm.de> wrote:
> Hello,
> I try to compute SHA hashes for different files:
> for root, dirs, files in os.walk(sys.argv[1]):
> for file in files:
> path = os.path.join(root, file)
> print path
> f = open(path)
> sha = sha.new(f.read())
^^^
Now the name "sha" no longer refers to the sha module, but to the object
returned by sha.new. Use a different name.
> sha.update(f.read())
> print sha.hexdigest()
Regards,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
More information about the Python-list
mailing list