erasing and writing test on console.

Stephen Coursen coursesm at sbdhcp-4022.statenisland-ny.est.tcg.com
Tue Feb 15 09:53:21 EST 2000


On Tue, 15 Feb 2000 14:18:21 GMT, bowman <bowman at montana.com> wrote:
>J.C.Travers <J.C.Travers at durham.ac.uk> wrote:
>
>>where the 'zzzz bytes downloaded' is updated.
>>Do I need to use curses to do this, or is there a simpler way just using
>>the standard print and an erase function that I haven't heard of?
>
>Not the most elegant way, but one that usually works: set your print
>up so you are not emitting a new line. Then emit enough backspace characters
>to get back to the zzzz, and print the new number. 

Alternatively, you can emit '\r' without the '\n'.  Then reprint the entire
line.  The zzzz will change as appropriate.  It's a lot easier than
determining howmany backspaces to emit.

HTH,
Steve



More information about the Python-list mailing list