Silly me, print?

Just van Rossum just at letterror.com
Wed May 9 12:48:10 EDT 2001


Curtis Jensen wrote:
> 
> Courageous wrote:
> >
> > Silly me, I can't for the life of me remember how -- or even recall if it's
> > possible -- to print without a newline?
> >
> > C//
> 
> also, ther is:
> 
> >>> import sys
> >>> sys.__stdout__.write( 'string' )
> string>>>

You should *never* *ever* *EVER* write to sys.__stdout__. Use sys.stdout
instead. sys.__stdout__ is a backup reference the original builtin stdout
file, which can be handy if it gets lost after redirection. Redirection
should not be bypassed, and redirection happens through sys.stdout, not
__stdout__.

Just



More information about the Python-list mailing list