Script to show progress?

You should use python-progressbar

It's as simple to use as:

import progressbar as pb

progress = pb.ProgressBar(widgets=_widgets, maxval = 500000).start()
progvar = 0

for i in range(500000):  
    # Your code here
    progress.update(progvar + 1)
    progvar += 1

This will show a progress bar like:

Progress: |####################################################            |70%

A simple "infinite spinner" implementation:

import time
import itertools

for c in itertools.cycle('/-\|'):
    print(c, end = '\r')
    time.sleep(0.2)

tqdm is a more powerful one for this case. it has better features and comparability.

it is easy for usage, the code could be simple as:

from tqdm import tqdm
for i in tqdm(range(10000)):
    pass  # or do something else

customization is also easy for special cases.

here is a demo from the repo: