title: How to read/print the ( _io.TextIOWrapper) data?
body: <p>With the following code I want to > open a file > read the contents and strip the non-required lines > then write the data to the file and also read the file for downstream analyses.</p>
  
  <pre><code>with open("chr2_head25.gtf", 'r') as f,\
      open('test_output.txt', 'w+') as f2:
      for lines in f:
          if not lines.startswith('#'):
              f2.write(lines)
      f2.close()
  </code></pre>
  
  <p>Now, I want to read the f2 data and do further processing in pandas or other modules but I am running into a problem while reading the data(<code>f2</code>).</p>
  
  <pre><code>data = f2 # doesn't work
  print(data) #gives
  &lt;_io.TextIOWrapper name='test_output.txt' mode='w+' encoding='UTF-8'&gt;
  
  data = io.StringIO(f2)  # doesn't work
  # Error message
  Traceback (most recent call last):
    File "/home/everestial007/PycharmProjects/stitcher/pHASE-Stitcher-Markov/markov_final_test/phase_to_vcf.py", line 64, in &lt;module&gt;
  data = io.StringIO(f2)
  TypeError: initial_value must be str or None, not _io.TextIOWrapper
  </code></pre>