Assigning output from a simple python statement

Wilson Fletcher wilson at
Fri Mar 17 01:18:29 CET 2000

William Park <parkw at> wrote in article
<20000316151835.B1996 at>...
> On Thu, Mar 16, 2000 at 07:14:57AM +0000, Wilson Fletcher wrote:
> Usual solution is 'eval' for expression and 'exec' for statement (see

Yes. Correct me if I am wrong but isn't "print 'Hello World'" a statement ?

> online doc for details).  To capture all output to <stdout>, you can
> point 'sys.stdout' to some file, and later restore it to the default
> 'sys.__stdout__'.


More information about the Python-list mailing list