title: reading a os.popen(command) into a string
body: <p>I'm not to sure if my title is right.
  What I'm doing is writing a python script to automate some of my code writing.
  So I'm parsing through a .h file.
  but I want to expand all macros before I start.
  so I want to do a call to the shell to:</p>
  
  <pre><code>gcc -E myHeader.h
  </code></pre>
  
  <p>Which should out put the post preprocessed version of myHeader.h to stdout.
  Now I want to read all that output straight into a string for further processing.
  I've read that i can do this with popen, but I've never used pipe objects.</p>
  
  <p>how do i do this? </p>