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.
精彩评论