On Sun, Oct 31, 2010 at 10:03 PM, Yingjie Lan <lany...@yahoo.com> wrote: > Hi, > > Suppose I am working with two files simultaneously, > it might make sense to do this: > > with open('scores.csv'), open('grades.csv', wt) as f,g: > g.write(f.read()) > > sure, you can do this with nested with-blocks, > but the one above does not seem too complicated, > it is like having a multiple assignment... > > Any thoughts?
Guido's time machine strikes again! It's already in Python 3; your example would be spelled: with open('scores.csv') as f, open('grades.csv', wt) as g: g.write(f.read()) Cheers, Chris -- Where does GvR source his flux capacitors from? http://blog.rebertia.com -- http://mail.python.org/mailman/listinfo/python-list