[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:

#!/usr/bin/python
#Python 2.6.6

import time

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






More information about the Tutor mailing list