def countdown(t):
    for i in range(t, 0, -1):
        print('tasks done, now sleeping for %d seconds\r' % i, end=' ')
sys.stdout.flush()
time.sleep(1)
Display a countdown for the python sleep function