Assigning output from a simple python statement

Wilson Fletcher wilson at mclachlan.com.au
Thu Mar 16 19:18:29 EST 2000


William Park <parkw at better.net> wrote in article
<20000316151835.B1996 at better.net>...
> 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__'.

thanks



More information about the Python-list mailing list