Printing to console, no scroll

Tim Roberts timr at
Fri Jan 16 07:03:13 CET 2004

"Totte Karlsson" <mtk at> wrote:
>How can I print to the console without having it scrolling to a new line for
>each print statement?
>I want to print a count down in the console, but for each count it scrolls
>the screen (of course).
> Is there another way?
>Here is the simple script for now
>print "Closing window in :"
>for second in range(10):
>    time.sleep(1)
>    print `10-second` +" seconds"

print "Closing window in : "
for second in range(10,0,-1):
    print "%2d\x08\x08\x08" % second,

- Tim Roberts, timr at
  Providenza & Boekelheide, Inc.

More information about the Python-list mailing list