setvbuf() ??

Remco Gerlich scarblac at
Thu Mar 29 22:24:59 CEST 2001

Bruce Wolk <bawolk at> 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