Extract ZipFile using Python, display Progress Percentage?
问题 I know how to extract a zip archive using Python, but how exactly do I display the progress of that extraction in a percentage? 回答1: the extract method doesn't provide a call back for this so one would have to use getinfo to get the e uncompressed size and then open the file read from it in blocks and write it to the place you want the file to go and update the percentage one would also have to restore the mtime if that is wanted an example: import zipfile z = zipfile.ZipFile(some_source)