setvbuf() ??

Remco Gerlich scarblac at pino.selwerd.nl
Thu Mar 29 15:24:59 EST 2001


Bruce Wolk <bawolk at ucdavis.edu> wrote in comp.lang.python:
> Putting a trailing comma after the print statement eliminates the newline, but
> adds a trailing space.  Would periods separated by spaces work?
> 
> I would be curious if anyone knows how to eliminate the trailing space.

Either use sys.stdout.write() instead of print, or set sys.stdout.softspace
to 0 after the print command.

-- 
Remco Gerlich



More information about the Python-list mailing list