title: python "with" command and csv reader
body: <p>I have both csv readers and writers. I understand you have to open and close the underlying object. One way to do it it would be to first create the file object, f, use csv reader and then use f.close().</p>
  
  <p>However, I can't seem to do the following:</p>
  
  <pre><code>with open(outputpath) as f_outputfile:
  
      outputfile = csv.writer(f_outputfile)
  
  OTHER CODE HERE
  </code></pre>
  
  <p>What I want to do is open a bunch of readers at once and a bunch of writers at once and have them all close automatically. However, does that mean I have a nested "With" block?</p>