print to console without a line break

Qian Xu quian.xu at stud.tu-ilmenau.de
Tue Dec 23 09:52:50 EST 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