Ned Batchelder <n...@nedbatchelder.com> writes: > The important thing in a with statement is that the assigned name will > be closed (or otherwise exited) automatically. The open call is just > the expression used to assign the name. The expression there isn't > really important. This looks odd, but works the same as what you > have: > > input = open(self.full_path) > output = open(self.output_csv, 'ab') > with input as input, output as output: > ...
Excellent! That solves for me a significant irritation of the syntax for multiple context managers. Thank you. -- \ “The most common way people give up their power is by thinking | `\ they don't have any.” —Alice Walker | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list