How to show to the user a progression in a script?
Progress of script can also be printed and updated with sys module to the console:

import sys
from time import sleep

sys.stdout.write("Some job description: ")
sys.stdout.flush()
some_list = [0] * 100
for idx, item in enumerate(some_list):
    msg = "item %i of %i" % (idx, len(some_list)-1)
    sys.stdout.write(msg + chr(8) * len(msg))
    sys.stdout.flush()
    sleep(0.02)

sys.stdout.write("DONE" + " "*len(msg)+"\n")
sys.stdout.flush()


This can look like this:


You can also copy paste this next function to display a progress bar:

import time, sys

def update_progress(job_title, progress):
    length = 20 # modify this to change the length
    block = int(round(length*progress))
    msg = "\r{0}: [{1}] {2}%".format(job_title, "#"*block + "-"*(length-block), round(progress*100, 2))
    if progress &gt;= 1: msg += " DONE\r\n"
    sys.stdout.write(msg)
    sys.stdout.flush()

# Test
for i in range(100):
    time.sleep(0.1)
    update_progress("Some job", i/100.0)
update_progress("Some job", 1)


This results in: