"D'Arcy J.M. Cain" <[EMAIL PROTECTED]> writes:
> Hmm. Are you saying that the following doesn't work?
>
> $ python
> >>> f = open("test", "w")
> >>> import sys
> >>> sys.stdout = f
> >>> print "test message"
> >>> sys.exit(0)
> $ cat test
> test message
>
> > In other words, you can't change the object used by the 'print'
> > statement only by re-binding names (which is *all* that is done by
> > the '=' operator).
>
> Apparently I can.
I admit to not trying any of the above. I was explaining the behaviour
reported by the original poster, without experimenting to see if I
could reproduce the behaviour.
Thanks for being more diligent.
--
\ “All persons, living and dead, are purely coincidental.” |
`\ —_Timequake_, Kurt Vonnegut |
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list