sleep() function, perhaps.

Padraig at Linux.ie Padraig at Linux.ie
Wed Nov 26 12:07:46 CET 2003


Peter Hansen wrote:
> Padraig at Linux.ie wrote:
> 
>>Ryan Spencer wrote:
>>
>>>Hello Everyone,
>>>
>>>      I want to have a row of periods, separated by small, say, .5 second
>>>intervals between each other. Thus, for example, making it have the
>>>appearance of a progress "bar".
>>
>>You've got the answer for dots, here's a spinner in case it's useful:
>>
>>import sys, time
>>
>>spinner="|/-\\"
>>pos=0
>>
>>while 1:
>>     sys.stdout.write("\r"+spinner[pos])
>>     sys.stdout.flush()
>>     time.sleep(.5)
>>     pos+=1
>>     pos%=4
> 
> 
> And a quicky OO version for kicks (untested):

I thought you mean't an " .o0O" version initially
(like cdparanoia)

:-)

Pádraig.





More information about the Python-list mailing list