with block for multiple files

Yingjie Lan lanyjie at yahoo.com
Mon Nov 1 02:05:00 EDT 2010


> 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())
> 

Indeed! Thanks, Chris and James.

Yingjie


      



More information about the Python-list mailing list