sleep() function, perhaps.

Padraig at Linux.ie Padraig at Linux.ie
Tue Nov 25 10:59:29 EST 2003


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





More information about the Python-list mailing list