[Tutor] trying to get md5sums of a list of files

Magnus Lyckå magnus@thinkware.se
Thu Jul 17 12:58:02 2003


At 15:03 2003-07-17 +0100, John Moylan wrote:
>         md5sum = m.digest()
>         print m
>
>However, the output does not make sense, where have I gone wrong?

You have printed the md5 object instead of the digest. You assign
the digest to the variable md5sum, and then you never use that...

Simply do "print md5sum" instead of "print m"

Note that the value returned by .digest() is a *binary* string
though, you probably want a string of hex values:

md5sum = m.hexdigest()
print md5sum


--
Magnus Lycka (It's really Lyckå), magnus@thinkware.se
Thinkware AB, Sweden, www.thinkware.se
I code Python ~ The Agile Programming Language