use 'with' to redirect stdout

Jean-Paul Calderone exarkun at divmod.com
Mon Feb 11 09:17:40 EST 2008


On Mon, 11 Feb 2008 09:15:07 -0500, Neal Becker <ndbecker2 at gmail.com> wrote:
>Is there a simple way to use a 'with' statement to redirect stdout in a
>block?

Do you mean "without writing a context manager to do the redirection"?

Jean-Paul



More information about the Python-list mailing list