print and trailing white space

Peter Hansen peter at engcorp.com
Thu Sep 18 17:33:41 EDT 2003


Maxime Biais wrote:
> 
> Hello,
> 
> I know how to print a string without the trailing newline with a coma
> like :
> 
> print "hello word",
> 
> but this example add a white space after the string :(
> 
> Do you know how to avoid this white space without using write()

What's wrong with write() ?  Print is merely provided for convenience.
When it's not doing what you want, you are supposed to use write(),
not come up with weird hacks for print.

-Peter




More information about the Python-list mailing list