开发者

All files of a dir in tar as file-like obj

there is a simple way to get all files inside a spe开发者_Python百科cifically dir (dir that is in a tar file) one after another as a same file-like object?

TNX


Use TarFile.getmembers() to get all the entries in a tarball, and iterate through them to filter the ones you want. Pass each in turn to TarFile.extractfile() to get a file-like to the entry within the tarball.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜