print and trailing white space
M-a-S
NO-MAIL at hotmail.com
Thu Sep 18 20:32:59 EDT 2003
Thank you for a great example anyway!
M-a-S
"Peter Otten" <__peter__ at web.de> wrote in message news:bkdas5$usv$07$1 at news.t-online.com...
>
> >>> class Out(object):
> ... def _set_softspace(self, value):
> ... pass
> ... def _get_softspace(self):
> ... return False
> ... softspace = property(_get_softspace, _set_softspace)
> ... def write(self, s):
> ... sys.stdout.write(s)
> ...
> >>> out = Out()
> >>> print >> out, "a", "b", "c"
> abc
> >>> print >> out, "x",
> x>>>
>
> It's possible, but I'd rather go with write().
> And, please, never ever substitute sys.stdout with a similar object.
>
> Peter
More information about the Python-list
mailing list