Printing to console (No Scroll)

Samuel Walters swalters_usenet at yahoo.com
Thu Jan 15 00:30:12 EST 2004


The cheesy dirt simple way:

 print "Closing window in :"
 for second in range(10):
     time.sleep(1)
     #print enough spaces to cover up the last message.
     print " "*20 + "\r",
     print `10-second` +" seconds",

Note the comma at the end of each print statement.
That causes python not to output a newline.

HTH

Sam Walters.

-- 
Never forget the halloween documents.
http://www.opensource.org/halloween/
""" Where will Microsoft try to drag you today?
    Do you really want to go there?"""




More information about the Python-list mailing list