Printing dots in single-line

Alok Singhal use_reply_to at
Sat Nov 29 18:10:26 CET 2003

On Thu, 13 Nov 2003 12:22:01 -0300, trofe wrote:

> Hey there,
> I want to print some dots in a single-line while my program loads or
> does something. I tried with he following but it didn't work :(.
> while 1:
>     print '.',
> Prints line of dots separated by a whitespace (. . . . . . etc). Is
> there a way I can get it to display them without that white space
> (.......etc)?

print('.' * n)

where n is the number of dots you want to print.

Incidentally, I saw other responses, and most of them suggest
sys.stdout.write().  Is there a reason that is preferable over the
solution above?


More information about the Python-list mailing list