From: phd at sun.med.ru (Oleg Broytmann)
Date: Fri, 7 May 1999 12:04:43 +0400 (MSD)
Subject: Percent indication in place
In-Reply-To: <14129.58440.971497.903286@amarok.cnri.reston.va.us>
Message-ID: <Pine.SOL2.3.96.SK.990507120251.5765B-100000@sun.med.ru>
Content-Length: 1360
X-UID: 1750                                                

Hi!

   For DOS/UNIX comsoles I wrote ttyProgressBar:
http://sun.med.ru/~phd/Software/Python/misc.html
   Download pbar.tgz.

On Thu, 6 May 1999, Andrew M. Kuchling wrote:
> colmconn at my-dejanews.com writes:
> >How can I display a percentage-done indication that updates itself in place,
> >or show a "twirling baton" progress indicator?
> 
> 	 On a Unix terminal (and probably on an MS-DOS console), you
> can just print chr(8) to backspace, so a twirling display would look
> something like this:
> 
> import time, sys
> sys.stdout.write(' ')
> 
> for i in '|/-\|':
>     sys.stdout.write( chr(8)+i ) ; sys.stdout.flush() ; time.sleep(1)
> print
> 
> You have to flush standard output after each character so it gets
> immediately printed; otherwise they'll be buffered up, and the user
> won't see them.
> 
> -- 
> A.M. Kuchling			http://starship.python.net/crew/amk/
> You didn't join the rebellion, not because you felt I was wrong, but because
> you were too damned scared. What would you have done, had I won? Told me that
> you'd always supported me ideologically? That you were secretly cheering me on
> the whole time?
>     -- Lucifer berates Remiel, in SANDMAN #60: "The Kindly Ones:4"

Oleg.
---- 
   Oleg Broytmann     National Research Surgery Centre     phd2 at email.com
           Programmers don't die, they just GOSUB without RETURN.





