print to console without a line break

Qian Xu quian.xu at
Tue Dec 23 15:52:50 CET 2008

Lie Ryan wrote:
> If you don't mind an extra space, you can use this:
> print 'Testing something ...',
> # note the trailing comma

Thanks. However, the contents will be saved in buffer and will not be shown
until print "(last piece)"

sys.stdout.flush() can solve this problem :-)

More information about the Python-list mailing list