Python tarfile progress output?

前端 未结 6 1079
旧巷少年郎
旧巷少年郎 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 10:57

    You could use extract instead of extractall - you would be able to print the member names as they are being extracted. To get a list of members, you could use getmembers.

    A textual progressbar library can be found here:

    • http://code.google.com/p/python-progressbar/

    Tkinter snippet:

    • http://tkinter.unpythonic.net/wiki/ProgressBar

提交回复
热议问题