Python tarfile progress output?

前端 未结 6 1113
旧巷少年郎
旧巷少年郎 2021-02-07 10:41

I\'m using the following code to extract a tar file:

import tarfile
tar = tarfile.open(\"sample.tar.gz\")
tar.extractall()
tar.close()

However,

6条回答
  •  眼角桃花
    2021-02-07 11:01

    There's a cool solution here that overrides the tarfile module as a drop-in replacement and lets you specify a callback to update.

    https://github.com/thomaspurchas/tarfile-Progress-Reporter/

    updated based on comment

提交回复
热议问题