
March 15, 2009
12:58 p.m.
Nick Coghlan wrote:
Dedicated syntax (such as the form that Christian proposed) would fix this problem:
with lock, (open(infile) as fin), (open(outfile, 'w') as fout): fout.write(fin.read())
Could 'and' possibly be used sense it is a flow control operator in python. with lock and open(infile) as fin and open(outfile, 'w' as fout: fout.write(fin.read()) Ron