Printing dots in single-line

Jay O'Connor joconnor at cybermesa.com
Sat Nov 29 13:00:40 EST 2003


Alok Singhal wrote:

>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?
>  
>

The solution you give will not work when you want to do processing 
between each dot.





More information about the Python-list mailing list