Presenting output from md5.digest like md5sum from GNU textutils

Moshe Zadka moshez at
Mon May 29 14:53:21 CEST 2000

On Mon, 29 May 2000, [iso-8859-1] Pål Sollie wrote:

> Being a clueless newbie at Python I have no idea how to do this.
> I am trying to write a script that is to save the checksum of all the
> specified files to a database. I'd like to convert the output I get
> from md5.digest to a human-readable format. Decimal values would be
> OK, but I'd be thrilled to get the same output as md5sum from GNU
> textutils.


for c in digest:
	sys.stdout.write("%02X" % ord(c))

Moshe Zadka <moshez at> -- we put the penguin in .com

More information about the Python-list mailing list