dimanche 24 juillet 2016

Getting percentage complete of an md5 checksum

I am currently getting an md5 checksum as follows: >>> import hashlib >>> f = open(file) >>> m = hashlib.md5() >>> m.update(f.read()) >>> checksum = m.hedxigest() I need to return the checksum of a large video file, that will take several minutes to generate. How would I implement a percentage counter, such that it prints the percentage complete for each percentage while it is running. Something like: >>> checksum = m.hedxigest() 1% done... 2% done... etc.

Aucun commentaire:

Enregistrer un commentaire