title: Python read file within tar archive
body: <p>I have a file:"docs.tar.gz".The tar file has 4 files inside of which the fourth file is "docs.json" which is what I need.Im able to view the contents of the tar file using:</p>
  
  <pre><code>import tarfile
  tar=tarfile.open("docs.tar.gz")
  tar.getmembers()
  </code></pre>
  
  <p>How would I read the fourth file -the json file that I need?..Im unable to proceed after extracting the contents.Thanks!</p>