spinning star

Ian Bicking ianb at colorstudy.com
Tue May 27 01:20:01 EDT 2003


On Tue, 2003-05-27 at 00:06, Andrew Thomson wrote:
> not really mission critical here, but what would approach would one take
> to create a spinning star!.. ie, -\|/- etc etc..

Writing chr(13) does the trick, like:


chars = "/-\\|"
total = 10000
for i in range(total):
    sys.stdout.write(chr(13))
    sys.stdout.write('%s %i/%i     ' % (chars[i % 4], i, total))
    sys.stdout.flush()
    time.sleep(0.1)

-- 
Ian Bicking   ianb at colorstudy.com  http://colorstudy.com
PGP:  gpg --keyserver pgp.mit.edu --recv-keys 0x9B9E28B7
4869 N. Talman Ave., Chicago, IL 60625      773-275-7241






More information about the Python-list mailing list