[Tutor] Printing in the same place

brandon w thisisonlyatest at gmx.com
Wed Aug 17 05:05:38 CEST 2011

I am trying to print in the same place to make a clock in a tkinter 
window. I will loop the following code to update the time.

This seems to work but it is not printing in the same place:

#Python 2.6.6

import time

for t in range(5):
     digits = time.strftime('%H:%M:%S')
     print "\r", digits

More information about the Tutor mailing list