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().
However, I can't seem to do the following:
with open(outputpath) as f_outputfile:
outputfile = csv.writer(f_outputfile)
OTHER CODE HERE
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?
OTHER CODE HEREusef_outputfile?OTHER CODE HEREthe part that writes to the csv file?OTHER CODE HEREpart of the with block.