Florian Lindner wrote in news:[EMAIL PROTECTED] in
comp.lang.python:
> 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)
On Sat, 09 Jul 2005 13:49:12 +0200,
Florian Lindner <[EMAIL PROTECTED]> 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(
Florian Lindner 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)
print "sha is", repr(sha) ### self-help !!!
Florian Lindner wrote:
> sha = sha.new(f.read())
> this generates a traceback when sha.new() is called for the second time
You have reassigned the variable 'sha'.
First time around, sha is the sha module object as obtained by 'import
sha'. Second time around, sha is the SHA hashing obje
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())
sha.update(f.read())
print sha.hexdigest