with statement for two files

Paul Rubin http
Mon Jul 28 12:27:08 EDT 2008


braver <deliverable at gmail.com> writes:
> with open(src) as readin, open(dst,"w") as writin:   # WRONG: comma
> doesn't work
>   ...
> -- so that you have transactional safety for two file descriptors?

use contextlib.nexted().



More information about the Python-list mailing list