Printing to console, no scroll

Tim Roberts timr at probo.com
Fri Jan 16 01:03:13 EST 2004


"Totte Karlsson" <mtk at qm.com> 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,
    time.sleep(1)

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



More information about the Python-list mailing list