import time
import sys
for remaining in range(10, 0, -1):
    sys.stdout.write('\r')
sys.stdout.write('{:2d} seconds remaining.'.format(remaining))
sys.stdout.flush()
time.sleep(1)
sys.stdout.write('\rComplete!            \n')
Python: How do I display a timer in a terminal